From 996de7788316b76c93c35c2091b9728c075fc813 Mon Sep 17 00:00:00 2001 From: Narapureddy-Srikanth Date: Wed, 1 Dec 2021 12:06:41 +0530 Subject: [PATCH] fixed drawing bug as per #113 --- src/js/whiteboard.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/js/whiteboard.js b/src/js/whiteboard.js index 04e9c49..a129d9e 100644 --- a/src/js/whiteboard.js +++ b/src/js/whiteboard.js @@ -238,7 +238,6 @@ const whiteboard = { } if (ReadOnlyService.readOnlyActive) return; _this.drawFlag = false; - _this.drawId++; _this.ctx.globalCompositeOperation = _this.oldGCO; let currentPos = Point.fromEvent(e); @@ -271,9 +270,7 @@ const whiteboard = { }); _this.svgContainer.find("line").remove(); } else if (_this.tool === "pen") { - _this.drawId--; _this.pushPointSmoothPen(currentPos.x, currentPos.y); - _this.drawId++; } else if (_this.tool === "rect") { if (_this.pressedKeys.shift) { if ( @@ -407,6 +404,7 @@ const whiteboard = { imgDiv.draggable(); _this.svgContainer.find("rect").remove(); } + _this.drawId++; }; _this.mouseOverlay.on("mouseout", function (e) {