mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Slightly refactored selection tool
Now the move tool doesn't depend on how the selection has been made anymore
This commit is contained in:
@ -29,6 +29,13 @@ class LassoSelectionTool extends SelectionTool {
|
||||
|
||||
onEnd(mousePos) {
|
||||
super.onEnd(mousePos);
|
||||
new HistoryState().EditCanvas();
|
||||
|
||||
this.currentPixels.push[this.startMousePos[0] / currFile.zoom, this.startMousePos[1] / currFile.zoom];
|
||||
this.getSelection();
|
||||
|
||||
// Switch to the move tool so that the user can move the selection
|
||||
this.switchFunc(this.moveTool);
|
||||
}
|
||||
|
||||
onSelect() {
|
||||
@ -46,7 +53,6 @@ class LassoSelectionTool extends SelectionTool {
|
||||
let prevPoint = [];
|
||||
|
||||
currFile.VFXLayer.context.clearRect(0, 0, currFile.canvasSize[0], currFile.canvasSize[1]);
|
||||
//currFile.VFXLayer.context.setLineDash([2, 2]);
|
||||
currFile.VFXLayer.context.strokeStyle = 'rgba(0,0,0,1)';
|
||||
currFile.VFXLayer.context.fillStyle = 'rgba(0,0,0,1)';
|
||||
currFile.VFXLayer.context.lineWidth = 1;
|
||||
|
Reference in New Issue
Block a user