jarvisniu / vue-zoomer

Zoom the image or other thing with mouse or touch
MIT License
150 stars 37 forks source link

Is it possible to disable bounce/elastic zoom when reaching the bounds? #9

Closed alejandroiglesias closed 3 years ago

alejandroiglesias commented 5 years ago

I would like to know if this is possible since it causes a sluggish experience when using trackpad zoom and the max bounds are reached.

jarvisniu commented 5 years ago

This is caused by the inertia of the trackpad. This will occur at this operation sequence: scroll - leave quickly. And can be avoid by: scroll - stop a little moment - leave. I think it's very hard to fix by programming.

alejandroiglesias commented 5 years ago

Why would it be very hard to be fixed programmatically? You calculate the new scale, if it is less than minScale then you assign minScale instead of the calculated value. Same for maxScale.

duyngq commented 4 years ago

yeah, I got the same problem. And maybe there are lots of work to calculate with formula but can you help to fix it? I have to set to border as 800x800 since as my observation in inspector, the transform limit to 7xx x 7xx

Thanks a lot

peckomingo commented 4 years ago

Hello and thank you for the great component!

I also like to know if it is possible to disable the elasticity when the image is on/inside bounds.

Any news on this?

jarvisniu commented 3 years ago

Sorry, I have think it too complicated before. Now I have add a prop zoomingElastic: boolean to disable the zooming elastic effect. Upgrade to v0.3.9to use it.