mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
Merge pull request #316 from fsih/clearCursorPrev
Make sure to clear the cursor preview when saving undo state
This commit is contained in:
commit
78666c6e2a
1 changed files with 6 additions and 7 deletions
|
@ -125,7 +125,6 @@ class Blobbiness {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.tool.onMouseUp = function (event) {
|
this.tool.onMouseUp = function (event) {
|
||||||
blob.resizeCursorIfNeeded(event.point);
|
|
||||||
if (event.event.button > 0 || !this.active) return; // only first mouse button
|
if (event.event.button > 0 || !this.active) return; // only first mouse button
|
||||||
|
|
||||||
let lastPath;
|
let lastPath;
|
||||||
|
@ -143,11 +142,9 @@ class Blobbiness {
|
||||||
blob.mergeBrush(lastPath);
|
blob.mergeBrush(lastPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
blob.cursorPreview.visible = false;
|
blob.cursorPreview.remove();
|
||||||
|
blob.cursorPreview = null;
|
||||||
blob.onUpdateSvg();
|
blob.onUpdateSvg();
|
||||||
blob.cursorPreview.visible = true;
|
|
||||||
blob.cursorPreview.bringToFront();
|
|
||||||
blob.cursorPreview.position = event.point;
|
|
||||||
|
|
||||||
// Reset
|
// Reset
|
||||||
blob.brush = null;
|
blob.brush = null;
|
||||||
|
@ -432,8 +429,10 @@ class Blobbiness {
|
||||||
}
|
}
|
||||||
|
|
||||||
deactivateTool () {
|
deactivateTool () {
|
||||||
this.cursorPreview.remove();
|
if (this.cursorPreview) {
|
||||||
this.cursorPreview = null;
|
this.cursorPreview.remove();
|
||||||
|
this.cursorPreview = null;
|
||||||
|
}
|
||||||
this.tool.remove();
|
this.tool.remove();
|
||||||
this.tool = null;
|
this.tool = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue