refactor(viewport): Remove resize detector and optimize viewport resizing logic (#5006)

This commit is contained in:
Alireza authored and GitHub committed 2025-05-05 11:27:26 -04:00
1 parent 6337d2e9cb
commit 383f45823c
5 files changed
+38 -46

No files matched your search

-10
View File
@@ -232,16 +232,6 @@ export default async function init({
}
);
// resize the cornerstone viewport service when the grid size changes
// IMPORTANT: this should happen outside of the OHIFCornerstoneViewport
// since it will trigger a rerender of each viewport and each resizing
// the offscreen canvas which would result in a performance hit, this should
// done only once per grid resize here. Doing it once here, allows us to reduce
// the refreshRage(in ms) to 10 from 50. I tried with even 1 or 5 ms it worked fine
viewportGridService.subscribe(viewportGridService.EVENTS.GRID_SIZE_CHANGED, () => {
cornerstoneViewportService.resize(true);
});
initContextMenu({
cornerstoneViewportService,
customizationService,