feat(grid): remove viewportIndex and only rely on viewportId (#3591)

Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
This commit is contained in:
AlirezaandBill Wallace authored and GitHub committed 2023-08-30 16:46:55 -04:00
1 parent 5dafac7c92
commit 4c6ff873e8
83 files changed
+1309 -1123

No files matched your search

@@ -122,19 +122,6 @@ export default function getCommandsModule({
]);
}
},
incrementActiveViewport: () => {
const { activeViewportIndex, viewports } = viewportGridService.getState();
const nextViewportIndex = (activeViewportIndex + 1) % viewports.length;
viewportGridService.setActiveViewportIndex(nextViewportIndex);
},
decrementActiveViewport: () => {
const { activeViewportIndex, viewports } = viewportGridService.getState();
const nextViewportIndex =
(activeViewportIndex - 1 + viewports.length) % viewports.length;
viewportGridService.setActiveViewportIndex(nextViewportIndex);
},
toggleOverlays: () => {
// overlay
const overlays = document.getElementsByClassName(
@@ -149,8 +136,8 @@ export default function getCommandsModule({
}
// overview
const { activeViewportIndex, viewports } = viewportGridService.getState();
microscopyService.toggleOverviewMap(activeViewportIndex);
const { activeViewportId, viewports } = viewportGridService.getState();
microscopyService.toggleOverviewMap(activeViewportId);
},
toggleAnnotations: () => {
microscopyService.toggleROIsVisibility();
@@ -173,14 +160,6 @@ export default function getCommandsModule({
storeContexts: [] as any[],
options: {},
},
incrementActiveViewport: {
commandFn: actions.incrementActiveViewport,
storeContexts: [] as any[],
},
decrementActiveViewport: {
commandFn: actions.decrementActiveViewport,
storeContexts: [] as any[],
},
toggleOverlays: {
commandFn: actions.toggleOverlays,
storeContexts: [] as any[],