Skip to content

Commit 3afe6d8

Browse files
committed
Fix text rendering when overlapped with other gameobjects in the display list
1 parent b53c3a2 commit 3afe6d8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

v3/src/renderer/webgl/WebGLRenderer.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ var WebGLRenderer = new Class({
521521
dstTexture.texture = gl.createTexture();
522522
}
523523

524+
if (dstTexture != this.currentTexture)
525+
{
526+
this.currentRenderer.flush();
527+
}
528+
524529
if (shouldUpdateResource)
525530
{
526531
// Update resource
@@ -542,7 +547,10 @@ var WebGLRenderer = new Class({
542547
dstTexture.height = srcCanvas.height;
543548

544549
// We must rebind old texture
545-
this.currentTexture = null;
550+
if (dstTexture != this.currentTexture && this.currentTexture !== null)
551+
{
552+
gl.bindTexture(gl.TEXTURE_2D, this.currentTexture.texture);
553+
}
546554

547555
return dstTexture;
548556
},

0 commit comments

Comments
 (0)