Fixed selection tools dragging when the cursor is not in the selection

This commit is contained in:
Nicola
2022-01-31 23:17:15 +01:00
parent cdabbb4a5c
commit c5ede4cc69
5 changed files with 4 additions and 8 deletions

View File

@@ -75,6 +75,9 @@ 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)),