You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run across an issue while implementing Diva for a client. As seen in GIF below the renderer right aligns the page when zooming from a "no-horizontal-scrollbar" state to a "horizontal-scrollbar" state.
I have used the basic demo to illustrate the issue.
The expected result on zoom would be to zoom to center. The zoom-in function works properly and zooms on the center of the view window if the "horizontal-scrollbar" already exists.
The issue appears to lie in the handleZoom function of viewer-core.js. When a focalpoint is not provided (zoom button clicked, not a double click) we see: offset.left = (viewport.width / 2) - (currentRegion.left - viewport.left)
After reviewing the values of viewport and currentRegion I was unable to understand when and where these values are calculated during the zoom process. They appear to jump around severely when moving between "no-horizontal-scrollbar" state to a "horizontal-scrollbar" state.
The revised code below produces a centered view on zoom into a horizontal scrollbar state, but harms the math for the next zoom-in level when the scrollbar exists: offset.left = (viewport.width > (viewport._innerDimensions.width / 2) ? (viewport._innerDimensions.width / 2) : viewport.width)/2 - (currentRegion.left - viewport.left)
Am I missing a setting for center align on zoom or has anyone else seen this issue?
Your help and consideration are both greatly appreciated.
Thanks
The text was updated successfully, but these errors were encountered:
This issue also exists when double click zooming (so a focalPoint is given, anywhere on the page) from specific zoom levels and page views. Therefore, it seems like the issue shouldn't even be within the focalPoint calculation (where
is calculated) since this calculation shouldn't even happen when double click zooming
Using the basic demo:
In single page view, going from zoomLevel2.0 and 3.0 will right align the page, whether using the zoom buttons or double click zooming (anywhere on the page)
In book page view, going from zoomLevel1.0 and 2.0 will right align the page, using either zoom method as well.
It is likely that these exact zoomLevels are only compatible with my exact viewport size.
eg. the horizontal scrollbar only appears at zoomlevel3.0 in single page , but could be at 2.0 for another monitor
Overall it seems that once the zoom level crosses the horizontal scrollbar threshold, the image gets scrolled some pixels to the right (~200px), regardless of where the mouse is. If using double click zooming, it'll still nearly centre around the mouse, but it will offset to the right just a tad
Hello,
I have run across an issue while implementing Diva for a client. As seen in GIF below the renderer right aligns the page when zooming from a "no-horizontal-scrollbar" state to a "horizontal-scrollbar" state.
I have used the basic demo to illustrate the issue.
The expected result on zoom would be to zoom to center. The zoom-in function works properly and zooms on the center of the view window if the "horizontal-scrollbar" already exists.
The issue appears to lie in the handleZoom function of viewer-core.js. When a focalpoint is not provided (zoom button clicked, not a double click) we see:
offset.left = (viewport.width / 2) - (currentRegion.left - viewport.left)
After reviewing the values of viewport and currentRegion I was unable to understand when and where these values are calculated during the zoom process. They appear to jump around severely when moving between "no-horizontal-scrollbar" state to a "horizontal-scrollbar" state.
The revised code below produces a centered view on zoom into a horizontal scrollbar state, but harms the math for the next zoom-in level when the scrollbar exists:
offset.left = (viewport.width > (viewport._innerDimensions.width / 2) ? (viewport._innerDimensions.width / 2) : viewport.width)/2 - (currentRegion.left - viewport.left)
Am I missing a setting for center align on zoom or has anyone else seen this issue?
Your help and consideration are both greatly appreciated.
Thanks
The text was updated successfully, but these errors were encountered: