release things on deactivate

This commit is contained in:
DD 2017-09-22 14:02:18 -04:00
parent 32661dde92
commit 33d8dd30b5
2 changed files with 6 additions and 1 deletions

View file

@ -197,7 +197,6 @@ class ReshapeTool extends paper.Tool {
this.setHoveredItem = null;
this.clearHoveredItem = null;
this.onUpdateSvg = null;
this.prevHoveredItemId = null;
this.lastEvent = null;
}
}

View file

@ -31,6 +31,7 @@ class SelectTool extends paper.Tool {
this.boundingBoxTool = new BoundingBoxTool(onUpdateSvg);
this.selectionBoxTool = new SelectionBoxTool(Modes.SELECT);
this.selectionBoxMode = false;
this.prevHoveredItemId = null;
// We have to set these functions instead of just declaring them because
// paper.js tools hook up the listeners in the setter functions.
@ -131,6 +132,11 @@ class SelectTool extends paper.Tool {
deactivateTool () {
this.clearHoveredItem();
this.boundingBoxTool.removeBoundsPath();
this.setHoveredItem = null;
this.clearHoveredItem = null;
this.onUpdateSvg = null;
this.boundingBoxTool = null;
this.selectionBoxTool = null;
}
}