Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Add debounced resize event handler #8

@swederik

Description

@swederik

In OHIF we have a resize handler which is debounced to fire 100ms after resizing stops. This prevents needless re-computation / redraws while the browser is being resized (or the device is being rotated to a new orientation).

The VTK plugin should incorporate something similar. Somehow I think it makes more sense to implement this at the plugin level.

You can call volumeViewport.resize(), as is done here:

// TODO: VTK's canvas currently does not fill the viewport element
// after it has been resized. We need to set the height to 100% and
// trigger volumeViewer.resize() whenever things are resized.
// We might need to find a way to hook onto the OHIF Viewer ResizeManager
// div.querySelector('canvas').style.height = '100%';
volumeViewer.resize();

For reference: https://github.com/OHIF/Viewers/blob/master/Packages/ohif-viewerbase/client/lib/classes/ResizeViewportManager.js#L127

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions