Fixed lasso selection

This commit is contained in:
Nicola
2022-01-08 19:16:15 +01:00
parent ac18dff161
commit d92a2cd1cd
2 changed files with 7 additions and 14 deletions

View File

@@ -1,8 +1,5 @@
/** TODO:
* - Clear cut selection
* - Clear copy selection
* - Clear paste selection
*
* - Test with lasso
*/
class MoveSelectionTool extends DrawingTool {
@@ -70,7 +67,6 @@ class MoveSelectionTool extends DrawingTool {
onDrag(mousePos) {
super.onDrag(mousePos);
// TODO: add (or subtract?) vector (boundingBoxCenter - canvasCenter);
this.selectionTool.moveOffset =
[Math.floor(mousePos[0] / currFile.zoom - currFile.canvasSize[0] / 2 - (this.selectionTool.boundingBoxCenter[0] - currFile.canvasSize[0]/2)),
Math.floor(mousePos[1] / currFile.zoom - currFile.canvasSize[1] / 2- (this.selectionTool.boundingBoxCenter[1] - currFile.canvasSize[1]/2))];