From d80b18282d3eebe06f6ffa849e4fcbf686e60547 Mon Sep 17 00:00:00 2001 From: raphael Date: Thu, 20 May 2021 17:16:02 +0200 Subject: [PATCH] empty textCointainer on rezize so we don't have double text elements --- src/js/whiteboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/whiteboard.js b/src/js/whiteboard.js index cd15319..ef7ad14 100644 --- a/src/js/whiteboard.js +++ b/src/js/whiteboard.js @@ -118,11 +118,12 @@ const whiteboard = { this.oldGCO = this.ctx.globalCompositeOperation; window.addEventListener("resize", function () { - // Handel resize + // Handle resize const dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); // Copy the buffer _this.canvas.width = $(window).width(); _this.canvas.height = $(window).height(); // Set new canvas height _this.drawBuffer = []; + _this.textContainer.empty(); _this.loadData(dbCp); // draw old content in });