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:
parent
eada0f7ab1
commit
37d21f5dec
@ -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();
|
||||
|
@ -67,10 +67,6 @@ class RectangularSelectionTool extends SelectionTool {
|
||||
this.moveTool.setSelectionData(this.getSelection(), this);
|
||||
}
|
||||
|
||||
copySelection() {
|
||||
super.copySelection();
|
||||
}
|
||||
|
||||
cutSelection() {
|
||||
super.cutSelection();
|
||||
currFile.currentLayer.context.clearRect(this.currSelection.left-0.5, this.currSelection.top-0.5,
|
||||
|
@ -1,10 +1,3 @@
|
||||
/** TODO
|
||||
* - Once the selected pixels have been obtained, save the selection outline in an image data
|
||||
* - The move tool will then move those image datas and they'll be pasted on the right layer
|
||||
* at the end of the selection
|
||||
*
|
||||
*/
|
||||
|
||||
class SelectionTool extends Tool {
|
||||
switchFunc = undefined;
|
||||
moveTool = undefined;
|
||||
@ -144,10 +137,6 @@ class SelectionTool extends Tool {
|
||||
|
||||
currFile.VFXLayer.canvas.style.zIndex = MIN_Z_INDEX;
|
||||
}
|
||||
|
||||
copySelection() {
|
||||
|
||||
}
|
||||
|
||||
cursorInSelectedArea(mousePos) {
|
||||
let floored = [Math.floor(mousePos[0] / currFile.zoom) - this.moveOffset[0],
|
||||
|
Loading…
Reference in New Issue
Block a user