Skip to content
Snippets Groups Projects
Commit 4f6b3470 authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

box-delete only active when delete tool is active

parent e01996e2
No related branches found
No related tags found
No related merge requests found
Pipeline #52772 passed
...@@ -12,12 +12,21 @@ export default class DeleteTool extends Tool { ...@@ -12,12 +12,21 @@ export default class DeleteTool extends Tool {
constructor(key) { constructor(key) {
super("Delete", "delete", key, new ToolMenu()); super("Delete", "delete", key, new ToolMenu());
this.setupBoxSelect(); this.setupBoxSelect();
this.isActive = false;
if (deleteToolInstance === undefined) { if (deleteToolInstance === undefined) {
deleteToolInstance = this; deleteToolInstance = this;
} }
} }
onToolActivate() {
this.isActive = true;
}
onToolDeactivate(nextTool) {
this.isActive = false;
}
onBoxSelect(left, bottom, top, right) { onBoxSelect(left, bottom, top, right) {
// Filter out selected nodes // Filter out selected nodes
const hitNodes = []; const hitNodes = [];
...@@ -79,6 +88,11 @@ export default class DeleteTool extends Tool { ...@@ -79,6 +88,11 @@ export default class DeleteTool extends Tool {
} }
boxSelectOnPointerDown(e) { boxSelectOnPointerDown(e) {
// Only do anything if delete tool is also active
if (deleteToolInstance === undefined || deleteToolInstance.isActive == false) {
return;
}
if (!e.shiftKey) { if (!e.shiftKey) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment