-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Max and Min Scale #12
Comments
Hello, I really need some help with that. I would be appreciated if you can. |
You can do this if you keep track of zoom in rotscale function, would you like to attempt? |
There is another long refactor in progress in another branch, so I won't take this soon. |
Thank you for your response. You think how long is it going to take for you to add this option? I don't know how can I help but it might be good to see your logic on this so I may go further with it. |
I am actually only blocked on testing 1.0.7 version, then I can add this feature. |
Might be better to start a beta channel, so I can easily merge changes there. I had tested before releasing new version; but didn't check if new built binaries are correct. Because I usually check in at least one iOS and one android device. |
Are you asking if min and max scale limit is working with 1.0.7 version? If so, I don’t see an instruction about how to do it? If you’re asking about regardless of min/max scale limit, library is working like a charm in IOS and Android, even in Windows 10 kiosk mode. |
Ah brilliant, I will merge then and add your feature. |
Awesome! Looking forward to it, thanks a lot... |
I have run into some problems, mainly due to state management; zoom limits are easy but haven't worked out how to manage events when it has maxed out. Will probably try again next weekend. |
Is it something that is about to ship? |
Not yet. @rubavahini do you have any clever ideas? |
I had the same need. All I did was simple modify the function that return the css matrix.
Is not a fancy solution but it works. |
the difficulty with the feature is, when using rotation and panning, it is not clear how to gracefully return the element to its original bounds as the scale is reduced. |
@diachedelic the idea i had was cancel the transform if the scale exceeds or goes below the limits. |
for example in https://github.com/anitasv/zoom/blob/master/zoom.js#L379, if resultantZoom has higher zoom then do not update. But the problem is rotation also gets cancelled. Ideally additionalZoom can be realigned to maintain rotation but don't scale. |
@anitasv what about gradually blending the transform with identity as the scale gets closer to min? Although, if |
@anitasv wait, that doesn't help with rotation. i think the main challenge is animating it smoothly at the min & max |
smoothness is fine, it will just stop updating once it hits the maximum/minimum. At least I guess, should code and see how it looks. |
but what if the element was panned during zooming? it will not end up back in its original position, which is surprising for the user i suppose this is really two separate issues:
|
I am sorry I do not think I am explaining it very well |
Yes, pan and rotation will stop the moment fingers are too wide causing zoom level to exceed max. It will act stuck, until you bring the fingers closer. |
But it is not too hard to fix that as well, the magnitude of zoom can be calculated and renormalized. |
ok! I will do a proof of concept |
transform = [ [ c s; -c s]; pan] something like this will not have pan and rotation issue, but not sure if above pseudo code is right or not. |
Hello there! Thank you for such a great library. It was really what I need and very light-weight comparing the others. Yet what I would like to see is an option that I can set max and min scale values. I would be appreciated if you can help me with that.
The text was updated successfully, but these errors were encountered: