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
You have two function, zoomIn() - zooms the viewer by the scale of 1.25 and zoomOut() that scales the viewer by the factor of 1 / 1.25 (0.8).
So from my understanding, if I set a scaleFactorMin to 1, it would let the value of zoom to equal one. So if I click on the zoom in button once and then zoom out once I would expect the viewer to come back to the same position since 1.25 * 0.8 = 1. Unfortunetely it doesnt work as expected. It does not come back to zoom value of 1.
function lessThanScaleFactorMin actually checks if the calculated value is LESS OR EQUAL, hence it stops from setting the value equal to scaleFactorMin.
The text was updated successfully, but these errors were encountered:
I did few tests and I agree with you, both lessThanScaleFactorMin and moreThanScaleFactorMax codes have to be replaced with a STRICT COMPARE operator. I'll release a fix in a couple day, in the meantime a rapid workaround is to sum (or substract) an EPSILON
Hi, thanks for all the work you did in the library, it works really nice.
I found a little bug I think, please consider this example:
https://jsfiddle.net/546yqbzk/
You have two function, zoomIn() - zooms the viewer by the scale of 1.25 and zoomOut() that scales the viewer by the factor of 1 / 1.25 (0.8).
So from my understanding, if I set a scaleFactorMin to 1, it would let the value of zoom to equal one. So if I click on the zoom in button once and then zoom out once I would expect the viewer to come back to the same position since 1.25 * 0.8 = 1. Unfortunetely it doesnt work as expected. It does not come back to zoom value of 1.
I think the problem lies in the
react-svg-pan-zoom/src/features/zoom.js
Line 10 in b92c6ce
function lessThanScaleFactorMin actually checks if the calculated value is LESS OR EQUAL, hence it stops from setting the value equal to scaleFactorMin.
The text was updated successfully, but these errors were encountered: