mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-29 09:24:45 +01:00
Use mouse position when undo/redo/reset
This commit is contained in:
parent
4c07c5372d
commit
08f195eb12
1 changed files with 10 additions and 4 deletions
|
@ -169,7 +169,7 @@ function initDraw() {
|
|||
if (!dragging && drawing && path.length > 0) {
|
||||
|
||||
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||
render(path.concat([coords]));
|
||||
render([...path, coords]);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -204,16 +204,22 @@ function initDraw() {
|
|||
finish();
|
||||
});
|
||||
|
||||
undoButton.addEventListener("click", function() {
|
||||
undoButton.addEventListener("click", function(e) {
|
||||
undo();
|
||||
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||
render([...path, coords]);
|
||||
});
|
||||
|
||||
redoButton.addEventListener("click", function() {
|
||||
redoButton.addEventListener("click", function(e) {
|
||||
redo();
|
||||
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||
render([...path, coords]);
|
||||
});
|
||||
|
||||
resetButton.addEventListener("click", function() {
|
||||
resetButton.addEventListener("click", function(e) {
|
||||
reset();
|
||||
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||
render([...path, coords]);
|
||||
});
|
||||
|
||||
resetButton.addEventListener("blur", function() {
|
||||
|
|
Loading…
Reference in a new issue