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:
@@ -75,9 +75,6 @@ class MoveSelectionTool extends DrawingTool {
|
||||
|
||||
onDrag(mousePos) {
|
||||
super.onDrag(mousePos);
|
||||
|
||||
if (!this.selectionTool.cursorInSelectedArea(mousePos))
|
||||
return;
|
||||
|
||||
this.selectionTool.moveOffset =
|
||||
[Math.floor(mousePos[0] / currFile.zoom - currFile.canvasSize[0] / 2 - (this.selectionTool.boundingBoxCenter[0] - currFile.canvasSize[0]/2)),
|
||||
@@ -98,8 +95,7 @@ class MoveSelectionTool extends DrawingTool {
|
||||
super.onEnd(mousePos, mouseTarget);
|
||||
|
||||
if (!this.selectionTool.cursorInSelectedArea(mousePos) &&
|
||||
!Util.isChildOfByClass(mouseTarget, "editor-top-menu") &&
|
||||
Util.cursorInCanvas(currFile.canvasSize, [mousePos[0]/currFile.zoom, mousePos[1]/currFile.zoom])) {
|
||||
!Util.isChildOfByClass(mouseTarget, "editor-top-menu")) {
|
||||
this.endSelection();
|
||||
// Switch to selection tool
|
||||
this.switchFunc(this.selectionTool);
|
||||
|
||||
Reference in New Issue
Block a user