mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed bugs
Hid brush size arrows in firefox, let the user cancel a selection by clicking outside the canvas, fixed lasso tool not detecting the selection if ending it outside the canvas.
This commit is contained in:
@@ -58,8 +58,7 @@ class RectangularSelectionTool extends SelectionTool {
|
||||
onEnd(mousePos, mouseTarget) {
|
||||
super.onEnd(mousePos, mouseTarget);
|
||||
|
||||
if (Util.isChildOfByClass(mouseTarget, "editor-top-menu") ||
|
||||
!Util.cursorInCanvas(currFile.canvasSize, [mousePos[0]/currFile.zoom, mousePos[1]/currFile.zoom]))
|
||||
if (Util.isChildOfByClass(mouseTarget, "editor-top-menu"))
|
||||
return;
|
||||
|
||||
new HistoryState().EditCanvas();
|
||||
@@ -80,10 +79,12 @@ class RectangularSelectionTool extends SelectionTool {
|
||||
this.startMousePos[1] = tmp;
|
||||
}
|
||||
|
||||
this.boundingBox.minX = this.startMousePos[0] - 1;
|
||||
this.boundingBox.maxX = this.endMousePos[0] + 1;
|
||||
this.boundingBox.minY = this.startMousePos[1] - 1;
|
||||
this.boundingBox.maxY = this.endMousePos[1] + 1;
|
||||
if (Util.cursorInCanvas(currFile.canvasSize, [mousePos[0]/currFile.zoom, mousePos[1]/currFile.zoom])) {
|
||||
this.boundingBox.minX = this.startMousePos[0] - 1;
|
||||
this.boundingBox.maxX = this.endMousePos[0] + 1;
|
||||
this.boundingBox.minY = this.startMousePos[1] - 1;
|
||||
this.boundingBox.maxY = this.endMousePos[1] + 1;
|
||||
}
|
||||
|
||||
// Switch to the move tool so that the user can move the selection
|
||||
this.switchFunc(this.moveTool);
|
||||
|
||||
Reference in New Issue
Block a user