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:
@ -33,8 +33,7 @@ class LassoSelectionTool extends SelectionTool {
|
||||
onDrag(mousePos, mouseTarget) {
|
||||
super.onDrag(mousePos, mouseTarget);
|
||||
|
||||
if (Util.isChildOfByClass(mouseTarget, "editor-top-menu") ||
|
||||
!Util.cursorInCanvas(currFile.canvasSize, [mousePos[0]/currFile.zoom, mousePos[1]/currFile.zoom]))
|
||||
if (!Util.cursorInCanvas(currFile.canvasSize, [mousePos[0]/currFile.zoom, mousePos[1]/currFile.zoom]))
|
||||
return;
|
||||
|
||||
if (this.currentPixels[this.currentPixels.length - 1] != mousePos)
|
||||
@ -47,8 +46,7 @@ class LassoSelectionTool extends SelectionTool {
|
||||
super.onEnd(mousePos, mouseTarget);
|
||||
new HistoryState().EditCanvas();
|
||||
|
||||
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;
|
||||
|
||||
this.currentPixels.push([this.startMousePos[0] / currFile.zoom, this.startMousePos[1] / currFile.zoom]);
|
||||
|
Reference in New Issue
Block a user