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
When using the mouse wheel or pinch to zoom to certain area to zoom, it receives translateX and translateY and results to not going to the right place when zoomed.
Hi and thanks for posting this issue!
Is the title meant to include the word "incorrect"?
The issue here is that browsers treat HTML and SVG differently. Taking your example, and making no changes other than mapping the HTML elements to corresponding SVG elements, EasyPZ zooms in to the correct location: https://jsfiddle.net/michaschwab/wyh6L1qo/5/
So, EasyPZ's translate values are correct, but the issue here is that EasyPZ is designed for SVG whereas you're using it on HTML. If someone could point me to some resource that explains how SVG and HTML transformations differ, then I can add an extension to EasyPZ, which is a flag to EasyPZ that does the calculation for HTML elements instead of for SVG elements. I just don't know how the two differ at the moment.
I think the difference comes from different point of reference. In svg, transformations of the inner elements are applied in relation to the svg element. In case of css transforms of html elements, the transformation is in relation to the element itself (with an adjustment from the transform-origin property).
When using the mouse wheel or pinch to zoom to certain area to zoom, it receives translateX and translateY and results to not going to the right place when zoomed.
JS:
CSS
HTML:
Fiddle: https://jsfiddle.net/06mgqv8u/
The text was updated successfully, but these errors were encountered: