mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Continued cut -> paste implementation
There's only a bug, when pasting consecutively, every time it cuts the area again. There's probably some weird cut call somewhere.
This commit is contained in:
@ -58,8 +58,11 @@ class Tool {
|
||||
tools[i].classList.remove("selected");
|
||||
}
|
||||
|
||||
//give the button of the selected tool the .selected class
|
||||
document.getElementById(this.name+"-button").parentNode.classList.add("selected");
|
||||
let buttonNode = document.getElementById(this.name + "-button");
|
||||
//give the button of the selected tool the .selected class if the tool has a button
|
||||
if(buttonNode != null && buttonNode.parentNode != null) {
|
||||
document.getElementById(this.name+"-button").parentNode.classList.add("selected");
|
||||
}
|
||||
|
||||
//change cursor
|
||||
this.updateCursor();
|
||||
|
Reference in New Issue
Block a user