mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Removed all global variables, worked on File class and put canvas resizing functions in File
This commit is contained in:
@@ -19,15 +19,15 @@ class EraserTool extends ResizableTool {
|
||||
return;
|
||||
//draw line to current pixel
|
||||
if (cursorTarget.className == 'drawingCanvas' || cursorTarget.className == 'drawingCanvas') {
|
||||
currentLayer.drawLine(Math.floor(this.prevMousePos[0]/zoom),
|
||||
Math.floor(this.prevMousePos[1]/zoom),
|
||||
Math.floor(this.currMousePos[0]/zoom),
|
||||
Math.floor(this.currMousePos[1]/zoom),
|
||||
currFile.currentLayer.drawLine(Math.floor(this.prevMousePos[0]/currFile.zoom),
|
||||
Math.floor(this.prevMousePos[1]/currFile.zoom),
|
||||
Math.floor(this.currMousePos[0]/currFile.zoom),
|
||||
Math.floor(this.currMousePos[1]/currFile.zoom),
|
||||
this.currSize
|
||||
);
|
||||
}
|
||||
|
||||
currentLayer.updateLayerPreview();
|
||||
currFile.currentLayer.updateLayerPreview();
|
||||
}
|
||||
|
||||
onEnd(mousePos) {
|
||||
|
Reference in New Issue
Block a user