mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed bugs in new selection system
This commit is contained in:
@@ -5,8 +5,12 @@ class MagicWandTool extends SelectionTool {
|
||||
Events.on('click', this.mainButton, switchFunc, this);
|
||||
}
|
||||
|
||||
onEnd(mousePos) {
|
||||
super.onStart(mousePos);
|
||||
onEnd(mousePos, mouseTarget) {
|
||||
super.onStart(mousePos, mouseTarget);
|
||||
if (Util.isChildOfByClass(mouseTarget, "editor-top-menu") ||
|
||||
!Util.cursorInCanvas(currFile.canvasSize, [mousePos[0]/currFile.zoom, mousePos[1]/currFile.zoom]))
|
||||
return;
|
||||
|
||||
|
||||
this.switchFunc(this.moveTool);
|
||||
this.moveTool.setSelectionData(this.getSelection(), this);
|
||||
@@ -45,6 +49,9 @@ class MagicWandTool extends SelectionTool {
|
||||
// Put it on the TMP layer
|
||||
currFile.TMPLayer.context.putImageData(this.previewData, 0, 0);
|
||||
|
||||
// Draw the bounding box
|
||||
this.drawBoundingBox();
|
||||
|
||||
return selectedData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user