From 680bbe15e835cbc3a14459459d4b61a11009fcb0 Mon Sep 17 00:00:00 2001 From: DD Date: Thu, 1 Mar 2018 14:41:39 -0500 Subject: [PATCH 1/2] Make sure to clear the cursor preview when saving undo state so that it doesnt mysteriously return on undo --- src/helper/blob-tools/blob.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/helper/blob-tools/blob.js b/src/helper/blob-tools/blob.js index ce59d185..211ff022 100644 --- a/src/helper/blob-tools/blob.js +++ b/src/helper/blob-tools/blob.js @@ -127,7 +127,6 @@ class Blobbiness { }; this.tool.onMouseUp = function (event) { - blob.resizeCursorIfNeeded(event.point); if (event.event.button > 0 || !this.active) return; // only first mouse button let lastPath; @@ -145,11 +144,9 @@ class Blobbiness { blob.mergeBrush(lastPath); } - blob.cursorPreview.visible = false; + blob.cursorPreview.remove(); + blob.cursorPreview = null; blob.onUpdateSvg(); - blob.cursorPreview.visible = true; - blob.cursorPreview.bringToFront(); - blob.cursorPreview.position = event.point; // Reset blob.brush = null; From 00ae3fb3f8076c1f7df4bb993a259dcd65c37c36 Mon Sep 17 00:00:00 2001 From: DD Date: Thu, 1 Mar 2018 16:37:45 -0500 Subject: [PATCH 2/2] Fix crash when missing cursor preview --- src/helper/blob-tools/blob.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/helper/blob-tools/blob.js b/src/helper/blob-tools/blob.js index 211ff022..b4608052 100644 --- a/src/helper/blob-tools/blob.js +++ b/src/helper/blob-tools/blob.js @@ -431,8 +431,10 @@ class Blobbiness { } deactivateTool () { - this.cursorPreview.remove(); - this.cursorPreview = null; + if (this.cursorPreview) { + this.cursorPreview.remove(); + this.cursorPreview = null; + } this.tool.remove(); this.tool = null; }