mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
release things on deactivate
This commit is contained in:
parent
32661dde92
commit
33d8dd30b5
2 changed files with 6 additions and 1 deletions
|
@ -197,7 +197,6 @@ class ReshapeTool extends paper.Tool {
|
||||||
this.setHoveredItem = null;
|
this.setHoveredItem = null;
|
||||||
this.clearHoveredItem = null;
|
this.clearHoveredItem = null;
|
||||||
this.onUpdateSvg = null;
|
this.onUpdateSvg = null;
|
||||||
this.prevHoveredItemId = null;
|
|
||||||
this.lastEvent = null;
|
this.lastEvent = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ class SelectTool extends paper.Tool {
|
||||||
this.boundingBoxTool = new BoundingBoxTool(onUpdateSvg);
|
this.boundingBoxTool = new BoundingBoxTool(onUpdateSvg);
|
||||||
this.selectionBoxTool = new SelectionBoxTool(Modes.SELECT);
|
this.selectionBoxTool = new SelectionBoxTool(Modes.SELECT);
|
||||||
this.selectionBoxMode = false;
|
this.selectionBoxMode = false;
|
||||||
|
this.prevHoveredItemId = null;
|
||||||
|
|
||||||
// We have to set these functions instead of just declaring them because
|
// We have to set these functions instead of just declaring them because
|
||||||
// paper.js tools hook up the listeners in the setter functions.
|
// paper.js tools hook up the listeners in the setter functions.
|
||||||
|
@ -131,6 +132,11 @@ class SelectTool extends paper.Tool {
|
||||||
deactivateTool () {
|
deactivateTool () {
|
||||||
this.clearHoveredItem();
|
this.clearHoveredItem();
|
||||||
this.boundingBoxTool.removeBoundsPath();
|
this.boundingBoxTool.removeBoundsPath();
|
||||||
|
this.setHoveredItem = null;
|
||||||
|
this.clearHoveredItem = null;
|
||||||
|
this.onUpdateSvg = null;
|
||||||
|
this.boundingBoxTool = null;
|
||||||
|
this.selectionBoxTool = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue