Skip to content

Commit

Permalink
Merge pull request #423 from PaulHax/tool-hover
Browse files Browse the repository at this point in the history
Tool Fixes
  • Loading branch information
floryst authored Sep 18, 2023
2 parents 5ce0d5a + 05b0664 commit cfe374f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/tools/AnnotationContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const hideToolFromContextMenu = () => {

<template>
<v-menu
v-if="tool"
v-model="contextMenu.show"
class="position-absolute"
:style="{
Expand Down
12 changes: 9 additions & 3 deletions src/components/tools/rectangle/RectangleWidget2D.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
useRightClickContextMenu,
useHoverEvent,
} from '@/src/composables/annotationTool';
import { vtkRulerWidgetState } from '@/src/vtk/RulerWidget';
const useStore = useRectangleStore;
const vtkWidgetFactory = vtkRectangleWidget;
Expand Down Expand Up @@ -180,11 +181,16 @@ export default defineComponent({
secondPoint: false,
});
const widgetState = widgetFactory.getWidgetState();
onVTKEvent(widgetFactory.getWidgetState(), 'onModified', () => {
const updateVisibleState = (widgetState: vtkRulerWidgetState) => {
visibleStates.firstPoint = widgetState.getFirstPoint().getVisible();
visibleStates.secondPoint = widgetState.getSecondPoint().getVisible();
});
};
const widgetState = widgetFactory.getWidgetState();
onVTKEvent(widgetFactory.getWidgetState(), 'onModified', () =>
updateVisibleState(widgetState)
);
updateVisibleState(widgetState);
return {
tool,
Expand Down

0 comments on commit cfe374f

Please sign in to comment.