From 0ad8fff35db87c360b7ad159e5e1a4ad08bed84a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 26 May 2020 15:44:47 -0700 Subject: [PATCH] lightbox_canvas: Clear canvas with less obfuscation. Signed-off-by: Anders Kaseorg --- static/js/lightbox_canvas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/lightbox_canvas.js b/static/js/lightbox_canvas.js index a06c61092c..fbee2359f0 100644 --- a/static/js/lightbox_canvas.js +++ b/static/js/lightbox_canvas.js @@ -215,7 +215,7 @@ const funcs = { const w = canvas.width * meta.zoom; const h = canvas.height * meta.zoom; - canvas.width = canvas.width; + context.clearRect(0, 0, canvas.width, canvas.height); context.imageSmoothingEnabled = false; context.drawImage(meta.image, x, y, w, h);