mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Started implementing preview rect
At the moment there's a bug in the getCursorPos function, may have something to do with offsets. The rect is correctly drawn, but with a weird offset. Added vfx canvas for tools previews.
This commit is contained in:
@ -110,7 +110,7 @@ window.addEventListener("mouseup", function (mouseEvent) {
|
||||
}
|
||||
}
|
||||
else if (currentTool == 'rectselect') {
|
||||
endRectSelection();
|
||||
endRectSelection(mouseEvent);
|
||||
}
|
||||
|
||||
dragging = false;
|
||||
@ -241,10 +241,10 @@ function draw (mouseEvent) {
|
||||
else if (currentTool == 'rectselect') {
|
||||
if (dragging && !isRectSelecting) {
|
||||
isRectSelecting = true;
|
||||
startRectSelection();
|
||||
startRectSelection(mouseEvent);
|
||||
}
|
||||
else if (dragging && isRectSelecting) {
|
||||
updateRectSelection();
|
||||
updateRectSelection(mouseEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user