mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Polished previous bug fix
Now it's possible to use all non-resizable tool and even copy a locked layer to paste it on an unlocked one.
This commit is contained in:
5
js/tools/DrawingTool.js
Normal file
5
js/tools/DrawingTool.js
Normal file
@@ -0,0 +1,5 @@
|
||||
class DrawingTool extends Tool {
|
||||
constructor (name, options) {
|
||||
super(name, options);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
class FillTool extends Tool {
|
||||
class FillTool extends DrawingTool {
|
||||
constructor(name, options, switchFunction) {
|
||||
super(name, options);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class MoveSelectionTool extends Tool {
|
||||
class MoveSelectionTool extends DrawingTool {
|
||||
currSelection = undefined;
|
||||
selectionTool = undefined;
|
||||
endTool = undefined;
|
||||
@@ -25,6 +25,8 @@ class MoveSelectionTool extends Tool {
|
||||
}
|
||||
|
||||
cutSelection() {
|
||||
if (currFile.currentLayer.isLocked)
|
||||
return;
|
||||
this.cutting = true;
|
||||
this.lastCopiedSelection = this.currSelection;
|
||||
this.endSelection();
|
||||
@@ -35,6 +37,8 @@ class MoveSelectionTool extends Tool {
|
||||
}
|
||||
|
||||
pasteSelection() {
|
||||
if (currFile.currentLayer.isLocked)
|
||||
return;
|
||||
if (this.lastCopiedSelection === undefined)
|
||||
return;
|
||||
// Finish the current selection and start a new one with the same data
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class ResizableTool extends Tool {
|
||||
class ResizableTool extends DrawingTool {
|
||||
startResizePos = undefined;
|
||||
currSize = 1;
|
||||
prevSize = 1;
|
||||
|
||||
Reference in New Issue
Block a user