Added undo management for rectangle tool

This commit is contained in:
unsettledgames 2020-04-04 15:41:03 +02:00
parent ab0b3e81e3
commit 3bf5d5fbd3
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,6 @@ function changeTool (selectedTool) {
// Ending any selection in progress
if (currentTool.includes("select") && !selectedTool.includes("select") && !selectionCanceled) {
endSelection();
console.log("FINISCO");
}
//set tool and temp tje tje tpp;
currentTool = selectedTool;

View File

@ -21,7 +21,8 @@ window.addEventListener("mousedown", function (mouseEvent) {
currentTool = 'pan';
else if (mouseEvent.altKey)
currentTool = 'eyedropper';
else if (mouseEvent.target.className == 'drawingCanvas' && (currentTool == 'pencil' || currentTool == 'eraser'))
else if (mouseEvent.target.className == 'drawingCanvas' &&
(currentTool == 'pencil' || currentTool == 'eraser' || currentTool == 'rectangle'))
new HistoryStateEditCanvas();
else if (currentTool == 'moveselection') {
if (!cursorInSelectedArea()) {