File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 22import { onVTKEvent } from ' @/src/composables/onVTKEvent' ;
33import { WIDGET_PRIORITY } from ' @kitware/vtk.js/Widgets/Core/AbstractWidget/Constants' ;
44import { useToolSelectionStore } from ' @/src/store/tools/toolSelection' ;
5+ import { useToolStore } from ' @/src/store/tools' ;
6+ import { Tools } from ' @/src/store/tools/types' ;
57import { vtkAnnotationToolWidget } from ' @/src/vtk/ToolWidgetUtils/types' ;
68import { inject } from ' vue' ;
79import { VtkViewContext } from ' @/src/components/vtk/context' ;
@@ -10,11 +12,19 @@ const view = inject(VtkViewContext);
1012if (! view ) throw new Error (' No VtkView' );
1113
1214const selectionStore = useToolSelectionStore ();
15+ const toolStore = useToolStore ();
16+
17+ const PLACING_TOOLS = [Tools .Ruler , Tools .Rectangle , Tools .Polygon ];
1318
1419onVTKEvent (
1520 view .interactor ,
1621 ' onLeftButtonPress' ,
1722 (event : any ) => {
23+ if (PLACING_TOOLS .includes (toolStore .currentTool )) {
24+ // avoid bugs when starting a placing tool on an existing tool and right clicking and deleting existing tools
25+ return ;
26+ }
27+
1828 const withModifiers = !! (event .shiftKey || event .controlKey );
1929 const selectedData = view .widgetManager .getSelectedData ();
2030 if (' widget' in selectedData ) {
You can’t perform that action at this time.
0 commit comments