From 81b2a9cc4e18ce1dd1a447af589abecfe6a17db4 Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Sat, 28 Jun 2025 09:44:43 +0200 Subject: [PATCH] Remove redundant white background fill in CanvasIO Eliminated unnecessary code that filled temporary canvases with a white background in two methods. This streamlines canvas creation and avoids redundant operations. --- js/CanvasIO.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/js/CanvasIO.js b/js/CanvasIO.js index 05d06c1..d457037 100644 --- a/js/CanvasIO.js +++ b/js/CanvasIO.js @@ -57,8 +57,6 @@ export class CanvasIO { const {canvas: tempCanvas, ctx: tempCtx} = createCanvas(this.canvas.width, this.canvas.height); const {canvas: maskCanvas, ctx: maskCtx} = createCanvas(this.canvas.width, this.canvas.height); - tempCtx.fillStyle = '#ffffff'; - tempCtx.fillRect(0, 0, this.canvas.width, this.canvas.height); const visibilityCanvas = document.createElement('canvas'); visibilityCanvas.width = this.canvas.width; visibilityCanvas.height = this.canvas.height; @@ -240,8 +238,6 @@ export class CanvasIO { const {canvas: tempCanvas, ctx: tempCtx} = createCanvas(this.canvas.width, this.canvas.height); const {canvas: maskCanvas, ctx: maskCtx} = createCanvas(this.canvas.width, this.canvas.height); - tempCtx.fillStyle = '#ffffff'; - tempCtx.fillRect(0, 0, this.canvas.width, this.canvas.height); const visibilityCanvas = document.createElement('canvas'); visibilityCanvas.width = this.canvas.width; visibilityCanvas.height = this.canvas.height;