Clear text layer to the background color on creation

Prevents a black flash before the first draw
This commit is contained in:
Daniel Imms
2017-09-13 23:49:37 -07:00
parent b225866c27
commit 0a58628f74
+4
View File
@@ -33,6 +33,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
this._canvas.style.zIndex = zIndex.toString();
this._ctx = this._canvas.getContext('2d', {alpha});
this._ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
// Draw the background if this is an opaque layer
if (!alpha) {
this.clearAll();
}
container.appendChild(this._canvas);
}