mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 05:52:42 -05:00
Merge pull request #186 from fsih/selectionBoxShapeToools
Clean up selection state
This commit is contained in:
commit
25c92e23a5
4 changed files with 4 additions and 5 deletions
|
@ -121,7 +121,6 @@ class BoundingBoxTool {
|
|||
this._modeMap[this.mode].onMouseUp(event);
|
||||
|
||||
this.mode = null;
|
||||
this.setSelectionBounds();
|
||||
}
|
||||
setSelectionBounds () {
|
||||
this.removeBoundsPath();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue