panzoom icon indicating copy to clipboard operation
panzoom copied to clipboard

Different behaviour between smoothZoomAbs and zoomAbs

Open DanyUP opened this issue 6 years ago • 3 comments

I'm trying to to set a fixed zoom on an image, centering in the middle of the container. I correctly compute the center of the container element but when i call zoomAbs the image don't get zoomed and is shift fully on left. panzoomInstance.zoomAbs(center.x, center.y, zoomLevel);

If I use the same parameters with smoothZoomAbs, the image is correctly zoomed. panzoomInstance.smoothZoomAbs(center.x, center.y, zoomLevel);

I think that for small values of zoomLevel zoomAbs works correctly, but for high values (4/5), only smoothZoomAbs works as expected.

DanyUP avatar Feb 15 '20 22:02 DanyUP

Do you happen to have a jsbin to help us debug this?

anvaka avatar Feb 16 '20 21:02 anvaka

Hi! Sorry, I've been busy! I'll try to setup a jsbin in few days!

DanyUP avatar Feb 22 '20 10:02 DanyUP

Ok, here is the jsbin link: https://output.jsbin.com/qedopoxuzi

Working on it, I noticed that something looks wrong even with smooth zoom when the center is a bit close to the border. Tell me if I can help further! Thanks!

DanyUP avatar Feb 22 '20 11:02 DanyUP