mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-17 02:22:10 +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) {
|
if (!dragging && drawing && path.length > 0) {
|
||||||
|
|
||||||
const coords = getCanvasCoords(e.clientX, e.clientY);
|
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||||
render(path.concat([coords]));
|
render([...path, coords]);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -204,16 +204,22 @@ function initDraw() {
|
||||||
finish();
|
finish();
|
||||||
});
|
});
|
||||||
|
|
||||||
undoButton.addEventListener("click", function() {
|
undoButton.addEventListener("click", function(e) {
|
||||||
undo();
|
undo();
|
||||||
|
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||||
|
render([...path, coords]);
|
||||||
});
|
});
|
||||||
|
|
||||||
redoButton.addEventListener("click", function() {
|
redoButton.addEventListener("click", function(e) {
|
||||||
redo();
|
redo();
|
||||||
|
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||||
|
render([...path, coords]);
|
||||||
});
|
});
|
||||||
|
|
||||||
resetButton.addEventListener("click", function() {
|
resetButton.addEventListener("click", function(e) {
|
||||||
reset();
|
reset();
|
||||||
|
const coords = getCanvasCoords(e.clientX, e.clientY);
|
||||||
|
render([...path, coords]);
|
||||||
});
|
});
|
||||||
|
|
||||||
resetButton.addEventListener("blur", function() {
|
resetButton.addEventListener("blur", function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue