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) {
|
||||
blob.resizeCursorIfNeeded(event.point);
|
||||
if (event.event.button > 0 || !this.active) return; // only first mouse button
|
||||
|
||||
let lastPath;
|
||||
|
@ -143,11 +142,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;
|
||||
|
@ -432,8 +429,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue