diff --git a/packages/graphics/src/GraphicsGeometry.js b/packages/graphics/src/GraphicsGeometry.js index e2974d0..1cdb69b 100644 --- a/packages/graphics/src/GraphicsGeometry.js +++ b/packages/graphics/src/GraphicsGeometry.js @@ -403,7 +403,12 @@ updateBatches() { if (this.dirty === this.cacheDirty) return; - if (this.graphicsData.length === 0) return; + if (this.graphicsData.length === 0) + { + this.batchable = true; + + return; + } if (this.dirty !== this.cacheDirty) { diff --git a/packages/graphics/src/GraphicsGeometry.js b/packages/graphics/src/GraphicsGeometry.js index e2974d0..1cdb69b 100644 --- a/packages/graphics/src/GraphicsGeometry.js +++ b/packages/graphics/src/GraphicsGeometry.js @@ -403,7 +403,12 @@ updateBatches() { if (this.dirty === this.cacheDirty) return; - if (this.graphicsData.length === 0) return; + if (this.graphicsData.length === 0) + { + this.batchable = true; + + return; + } if (this.dirty !== this.cacheDirty) { diff --git a/packages/graphics/test/index.js b/packages/graphics/test/index.js index dfad53d..b6b4951 100644 --- a/packages/graphics/test/index.js +++ b/packages/graphics/test/index.js @@ -391,4 +391,16 @@ GRAPHICS_CURVES.adaptive = defMode; GRAPHICS_CURVES.maxLength = defMaxLen; }); + + describe('geometry', function () + { + it('should be batchable if graphicsData is empty', function () + { + const graphics = new Graphics(); + const geometry = graphics.geometry; + + geometry.updateBatches(); + expect(geometry.batchable).to.be.true; + }); + }); });