Skip to content

Commit

Permalink
fix(paint): stencil size is correct for when mouse starts in view
Browse files Browse the repository at this point in the history
If paint tool is activated when mouse is within a view, the stencil
shape would not be correct.  So call setSliceAxis at widget startup.
  • Loading branch information
PaulHax committed Nov 15, 2023
1 parent 9522fe5 commit 155da25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/tools/paint/PaintWidget2D.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ export default defineComponent({
const viewInteractor = computed(() => viewProxy.value!.getInteractor());
// Turn on widget visibility if mouse starts within view
// Turn on widget visibility and update stencil
// if mouse starts within view
onVTKEvent(viewInteractor, 'onMouseMove', () => {
if (!checkIfPointerInView) {
return;
}
checkIfPointerInView = false;
widgetRef.value!.setVisibility(true);
paintStore.setSliceAxis(viewAxisIndex.value);
});
onVTKEvent(viewInteractor, 'onMouseEnter', () => {
Expand Down

0 comments on commit 155da25

Please sign in to comment.