feat(resize): Optimize resizing process and maintain zoom level (#3889)

This commit is contained in:
Alireza authored and GitHub committed 2024-02-21 13:49:23 -05:00
1 parent a2a0090eeb
commit b3a0faf5f5
37 files changed
+1395 -968

No files matched your search

+10
View File
@@ -204,6 +204,16 @@ 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,