Skip to content

Commit 9f0a99c

Browse files
committed
fix(LayoutGrid): avoid maximizing view when annotating
1 parent 66d9082 commit 9f0a99c

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/components/LayoutGrid.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import { storeToRefs } from 'pinia';
2626
import { ViewTypeToComponent } from '@/src/core/viewTypes';
2727
import { Layout, LayoutDirection } from '../types/layout';
2828
import { useViewStore } from '../store/views';
29+
import { useToolStore } from '../store/tools';
30+
import { ALLOW_MAXIMIZE_TOOLS } from '../config';
2931
3032
export default defineComponent({
3133
name: 'LayoutGrid',
@@ -36,7 +38,10 @@ export default defineComponent({
3638
}
3739
},
3840
maximize(viewId: string) {
39-
useViewStore().toggleMaximizeView(viewId);
41+
const currentTool = useToolStore().currentTool;
42+
if (ALLOW_MAXIMIZE_TOOLS.includes(currentTool)) {
43+
useViewStore().toggleMaximizeView(viewId);
44+
}
4045
},
4146
},
4247
props: {

src/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Layout, LayoutDirection } from './types/layout';
88
import { ViewSpec } from './types/views';
99
import { SampleDataset } from './types';
1010
import { Action } from './constants';
11+
import { Tools } from './store/tools/types';
1112

1213
/**
1314
* These are the initial view IDs.
@@ -289,6 +290,14 @@ export const ACTION_TO_KEY = {
289290
showKeyboardShortcuts: '?',
290291
} satisfies Record<Action, string>;
291292

293+
export const ALLOW_MAXIMIZE_TOOLS = [
294+
Tools.WindowLevel,
295+
Tools.Pan,
296+
Tools.Zoom,
297+
Tools.Select,
298+
Tools.Crosshairs,
299+
] as const;
300+
292301
export const DEFAULT_SEGMENT_MASKS: SegmentMask[] = [
293302
{
294303
value: 1,

0 commit comments

Comments
 (0)