diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index b94c3b0..a550aec 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -723,10 +723,14 @@ { Graphics._SPRITE_TEXTURE = RenderTexture.create(10, 10); - const currentRenderTarget = renderer._activeRenderTarget; - renderer.bindRenderTexture(Graphics._SPRITE_TEXTURE); - renderer.clear([1,1,1,1]); - renderer.bindRenderTarget(currentRenderTarget); + const canvas = document.createElement('canvas'); + canvas.width = 10; + canvas.height = 10; + const context = canvas.getContext('2d'); + context.fillStyle = 'white'; + context.fillRect(0, 0, 10, 10); + Graphics._SPRITE_TEXTURE = Texture.fromCanvas(canvas); + } this._spriteRect = new Sprite(Graphics._SPRITE_TEXTURE);