mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed pasting selection with cusor out of canvas
This commit is contained in:
@@ -44,6 +44,10 @@ class MoveSelectionTool extends DrawingTool {
|
||||
return;
|
||||
if (this.lastCopiedSelection === undefined)
|
||||
return;
|
||||
if (!(this.currMousePos[0]/currFile.zoom >= 0 && this.currMousePos[1]/currFile.zoom >= 0 &&
|
||||
this.currMousePos[0]/currFile.zoom < currFile.canvasSize[0] && this.currMousePos[1]/currFile.zoom < currFile.canvasSize[1]))
|
||||
this.currMousePos = [currFile.canvasSize[0]*currFile.zoom / 2, currFile.canvasSize[1]*currFile.zoom /2];
|
||||
|
||||
// Finish the current selection and start a new one with the same data
|
||||
if (!this.cutting) {
|
||||
this.endSelection();
|
||||
|
||||
Reference in New Issue
Block a user