Merge pull request #186 from fsih/selectionBoxShapeToools

Clean up selection state
This commit is contained in:
DD Liu 2017-11-08 15:35:10 -05:00 committed by GitHub
commit 25c92e23a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 5 deletions

View file

@ -121,7 +121,6 @@ class BoundingBoxTool {
this._modeMap[this.mode].onMouseUp(event);
this.mode = null;
this.setSelectionBounds();
}
setSelectionBounds () {
this.removeBoundsPath();

View file

@ -45,7 +45,6 @@ class SelectTool extends paper.Tool {
selectRootItem();
setSelectedItems();
this.boundingBoxTool.setSelectionBounds();
}
/**
* To be called when the hovered item changes. When the select tool hovers over a
@ -125,7 +124,6 @@ class SelectTool extends paper.Tool {
if (this.selectionBoxMode) {
this.selectionBoxTool.onMouseUp(event);
this.boundingBoxTool.setSelectionBounds();
} else {
this.boundingBoxTool.onMouseUp(event);
}

View file

@ -18,6 +18,7 @@ class OvalTool extends paper.Tool {
*/
constructor (setSelectedItems, clearSelectedItems, onUpdateSvg) {
super();
this.setSelectedItems = setSelectedItems;
this.clearSelectedItems = clearSelectedItems;
this.onUpdateSvg = onUpdateSvg;
this.prevHoveredItemId = null;
@ -116,7 +117,7 @@ class OvalTool extends paper.Tool {
this.oval = null;
ovalPath.selected = true;
this.boundingBoxTool.setSelectionBounds();
this.setSelectedItems();
this.onUpdateSvg();
}
}

View file

@ -18,6 +18,7 @@ class RectTool extends paper.Tool {
*/
constructor (setSelectedItems, clearSelectedItems, onUpdateSvg) {
super();
this.setSelectedItems = setSelectedItems;
this.clearSelectedItems = clearSelectedItems;
this.onUpdateSvg = onUpdateSvg;
this.prevHoveredItemId = null;
@ -108,7 +109,7 @@ class RectTool extends paper.Tool {
this.rect = null;
} else {
this.rect.selected = true;
this.boundingBoxTool.setSelectionBounds();
this.setSelectedItems();
this.onUpdateSvg();
this.rect = null;
}