mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Merge branch 'master' into next-update
This commit is contained in:
commit
33f362ef09
@ -7,9 +7,24 @@ class BrushTool extends ResizableTool {
|
|||||||
Events.on('click', this.smallerButton, this.decreaseSize.bind(this));
|
Events.on('click', this.smallerButton, this.decreaseSize.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
onStart(mousePos) {
|
onStart(mousePos, cursorTarget) {
|
||||||
super.onStart(mousePos);
|
super.onStart(mousePos);
|
||||||
|
if (cursorTarget === undefined)
|
||||||
|
return;
|
||||||
new HistoryState().EditCanvas();
|
new HistoryState().EditCanvas();
|
||||||
|
|
||||||
|
//draw line to current pixel
|
||||||
|
if (cursorTarget.className == 'drawingCanvas' || cursorTarget.className == 'drawingCanvas') {
|
||||||
|
currFile.currentLayer.drawLine(
|
||||||
|
Math.floor(mousePos[0]/currFile.zoom),
|
||||||
|
Math.floor(mousePos[1]/currFile.zoom),
|
||||||
|
Math.floor(mousePos[0]/currFile.zoom),
|
||||||
|
Math.floor(mousePos[1]/currFile.zoom),
|
||||||
|
this.currSize
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
currFile.currentLayer.updateLayerPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
onDrag(mousePos, cursorTarget) {
|
onDrag(mousePos, cursorTarget) {
|
||||||
|
Loading…
Reference in New Issue
Block a user