Started making selection tools more generic

Will also hopefully remove MoveSelection.js and put its functions in SelectionTool
This commit is contained in:
Nicola
2022-01-05 23:54:29 +01:00
parent 240b0176c3
commit de2479b007
6 changed files with 187 additions and 159 deletions

View File

@ -76,8 +76,8 @@ class MoveSelectionTool extends DrawingTool {
// put the image data on the tmp layer with offset
currFile.TMPLayer.context.putImageData(
this.currSelection.data,
Math.round(mousePos[0] / currFile.zoom) - this.currSelection.width / 2,
Math.round(mousePos[1] / currFile.zoom) - this.currSelection.height / 2);
Math.floor(mousePos[0] / currFile.zoom - this.currSelection.width / 2),
Math.floor(mousePos[1] / currFile.zoom - this.currSelection.height / 2));
}
onEnd(mousePos) {