mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 06:24:17 +00:00
Fix selection UI remaining visible but inactive when switching tools
This commit is contained in:
parent
ed12e5d7e5
commit
b8478dc5da
1 changed files with 9 additions and 5 deletions
|
@ -491,15 +491,18 @@
|
|||
}
|
||||
|
||||
function switchTool() {
|
||||
selected = null;
|
||||
onquit();
|
||||
if (handTool.secondary.active) {
|
||||
window.addEventListener("keydown", deleteShortcut);
|
||||
window.addEventListener("keydown", duplicateShortcut);
|
||||
}
|
||||
else {
|
||||
window.removeEventListener("keydown", deleteShortcut);
|
||||
window.removeEventListener("keydown", duplicateShortcut);
|
||||
}
|
||||
}
|
||||
|
||||
function onquit() {
|
||||
selected = null;
|
||||
hideSelectionUI();
|
||||
window.removeEventListener("keydown", deleteShortcut);
|
||||
window.removeEventListener("keydown", duplicateShortcut);
|
||||
}
|
||||
|
||||
var handTool = { //The new tool
|
||||
|
@ -510,6 +513,7 @@
|
|||
"move": move,
|
||||
"release": release,
|
||||
},
|
||||
"onquit": onquit,
|
||||
"secondary": {
|
||||
"name": "Selector",
|
||||
"icon": "tools/hand/selector.svg",
|
||||
|
|
Loading…
Reference in a new issue