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:
@@ -38,6 +38,7 @@ window.addEventListener("mousedown", function (mouseEvent) {
|
|||||||
}
|
}
|
||||||
else if (mouseEvent.which == 2) {
|
else if (mouseEvent.which == 2) {
|
||||||
currentTool = tool.pan;
|
currentTool = tool.pan;
|
||||||
|
tool.pan.brushSize = currentToolTemp.brushSize;
|
||||||
}
|
}
|
||||||
else if (currentTool.name == 'pencil' && mouseEvent.which == 3) {
|
else if (currentTool.name == 'pencil' && mouseEvent.which == 3) {
|
||||||
currentTool = tool.resizebrush;
|
currentTool = tool.resizebrush;
|
||||||
@@ -171,6 +172,8 @@ window.addEventListener("mouseup", function (mouseEvent) {
|
|||||||
currentTool = currentToolTemp;
|
currentTool = currentToolTemp;
|
||||||
|
|
||||||
currentTool.updateCursor();
|
currentTool.updateCursor();
|
||||||
|
var cursorLocation = getCursorPosition(mouseEvent);
|
||||||
|
currentTool.moveBrushPreview(cursorLocation);
|
||||||
|
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ class Tool {
|
|||||||
|
|
||||||
if (options.imageCursor) this.cursor = "url(\'/pixel-editor/"+options.imageCursor+".png\'), auto";
|
if (options.imageCursor) this.cursor = "url(\'/pixel-editor/"+options.imageCursor+".png\'), auto";
|
||||||
|
|
||||||
|
this.currentBrushSize = 1;
|
||||||
|
this.previousBrushSize = 1;
|
||||||
if (options.brushPreview) {
|
if (options.brushPreview) {
|
||||||
this.brushPreview = true;
|
this.brushPreview = true;
|
||||||
this.currentBrushSize = 1;
|
|
||||||
this.previousBrushSize = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//add to tool object so it can be referenced
|
//add to tool object so it can be referenced
|
||||||
|
|||||||
Reference in New Issue
Block a user