File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ import { storeToRefs } from 'pinia';
2626import { ViewTypeToComponent } from ' @/src/core/viewTypes' ;
2727import { Layout , LayoutDirection } from ' ../types/layout' ;
2828import { useViewStore } from ' ../store/views' ;
29+ import { useToolStore } from ' ../store/tools' ;
30+ import { ALLOW_MAXIMIZE_TOOLS } from ' ../config' ;
2931
3032export 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: {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { Layout, LayoutDirection } from './types/layout';
88import { ViewSpec } from './types/views' ;
99import { SampleDataset } from './types' ;
1010import { 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+
292301export const DEFAULT_SEGMENT_MASKS : SegmentMask [ ] = [
293302 {
294303 value : 1 ,
You can’t perform that action at this time.
0 commit comments