mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added undo management for rectangle tool
This commit is contained in:
parent
ab0b3e81e3
commit
3bf5d5fbd3
@ -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;
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user