diff --git a/src/components/Settings.vue b/src/components/Settings.vue index 01678023..dea3e228 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -10,6 +10,14 @@ hide-details > + + import { defineComponent, ref, watch } from 'vue'; +import { storeToRefs } from 'pinia'; import { useTheme } from 'vuetify'; import { useLocalStorage } from '@vueuse/core'; @@ -50,6 +59,7 @@ import { useErrorReporting, errorReportingConfigured, } from '../utils/errorReporting'; +import { useViewCameraStore } from '@/src/store/view-configs/camera'; export default defineComponent({ setup() { @@ -68,6 +78,8 @@ export default defineComponent({ errorReportingStore.disableReporting = !enabled; }); + const { disableCameraAutoReset } = storeToRefs(useViewCameraStore()); + const keyboardStore = useKeyboardShortcutsStore(); const openKeyboardShortcuts = () => { keyboardStore.settingsOpen = true; @@ -78,6 +90,7 @@ export default defineComponent({ reportingEnabled, errorReportingConfigured, openKeyboardShortcuts, + disableCameraAutoReset, }; }, components: { diff --git a/src/components/SliceViewer.vue b/src/components/SliceViewer.vue index d7066bdd..2c6c228c 100644 --- a/src/components/SliceViewer.vue +++ b/src/components/SliceViewer.vue @@ -33,6 +33,7 @@ class="vtk-view" ref="vtkView" data-testid="vtk-view vtk-two-view" + :disable-auto-reset-camera="disableCameraAutoReset" :view-id="id" :image-id="currentImageID" :view-direction="viewDirection" @@ -172,6 +173,7 @@ import SliceSlider from '@/src/components/SliceSlider.vue'; import SliceViewerOverlay from '@/src/components/SliceViewerOverlay.vue'; import { useToolSelectionStore } from '@/src/store/tools/toolSelection'; import { useAnnotationToolStore, useToolStore } from '@/src/store/tools'; +import { useViewCameraStore } from '@/src/store/view-configs/camera'; import { doesToolFrameMatchViewAxis } from '@/src/composables/annotationTool'; import { useWebGLWatchdog } from '@/src/composables/useWebGLWatchdog'; import { useSliceConfig } from '@/src/composables/useSliceConfig'; @@ -192,6 +194,8 @@ const vtkView = ref(); const props = defineProps(); +const { disableCameraAutoReset } = storeToRefs(useViewCameraStore()); + const { id: viewId, type: viewType, viewDirection, viewUp } = toRefs(props); const viewAxis = computed(() => getLPSAxisFromDir(viewDirection.value)); diff --git a/src/components/vtk/VtkSliceView.vue b/src/components/vtk/VtkSliceView.vue index 2a0a2f54..4a0393ce 100644 --- a/src/components/vtk/VtkSliceView.vue +++ b/src/components/vtk/VtkSliceView.vue @@ -1,5 +1,6 @@