mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Move brushPreview when panning with mousewheel
This commit is contained in:
parent
ae82d64d5d
commit
d4de08e8be
@ -38,6 +38,7 @@ window.addEventListener("mousedown", function (mouseEvent) {
|
||||
}
|
||||
else if (mouseEvent.which == 2) {
|
||||
currentTool = tool.pan;
|
||||
tool.pan.brushSize = currentToolTemp.brushSize;
|
||||
}
|
||||
else if (currentTool.name == 'pencil' && mouseEvent.which == 3) {
|
||||
currentTool = tool.resizebrush;
|
||||
@ -171,6 +172,8 @@ window.addEventListener("mouseup", function (mouseEvent) {
|
||||
currentTool = currentToolTemp;
|
||||
|
||||
currentTool.updateCursor();
|
||||
var cursorLocation = getCursorPosition(mouseEvent);
|
||||
currentTool.moveBrushPreview(cursorLocation);
|
||||
|
||||
|
||||
}, false);
|
||||
|
@ -18,10 +18,10 @@ class Tool {
|
||||
|
||||
if (options.imageCursor) this.cursor = "url(\'/pixel-editor/"+options.imageCursor+".png\'), auto";
|
||||
|
||||
this.currentBrushSize = 1;
|
||||
this.previousBrushSize = 1;
|
||||
if (options.brushPreview) {
|
||||
this.brushPreview = true;
|
||||
this.currentBrushSize = 1;
|
||||
this.previousBrushSize = 1;
|
||||
}
|
||||
|
||||
//add to tool object so it can be referenced
|
||||
|
Loading…
Reference in New Issue
Block a user