-
Notifications
You must be signed in to change notification settings - Fork 141
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
Emit zoom end event 150 ms after last wheel event which had an effect #158
Comments
Sounds reasonable! |
Fixed in f4c6c79. |
FYI, I released this in 1.7.4, but then reverted it in 1.8.1. The problem with this change is that if you zooming by wheeling on a scrollable page, it will start scrolling as soon as you hit the limit of the scale extent. What we want instead is that these wheel events are considered part of the same wheeling gesture and thus continue to prevent scrolling, even though the transform is no longer changing. This way you can more predictably control whether the wheel-based gesture will trigger zooming or scrolling. |
Ah, so the Anyway, fair enough, I see how this could be a problem. In my own applications there are no scrollbars (unless the viewport height is very small) this is why this issue didn't show up for me. BTW, I just remembered that with Adobe Flash the behaviour apparently was that all wheeling lost its ability to scroll the page (or parent element) while the mouse pointer was hovering above the element in question. I understand why they would do it but it also was a pain in the posterior to suddenly not be able to scroll a page anymore if during scrolling a page such an element happened to sneak below the mouse pointer. |
Oh and I also just realised that browser vendors have to deal with a similar issue in terms of when to allow scrolling an element with The browsers also differ on when they dispatch the |
Currently a zoom
end
event is emitted 150 ms after the last wheel event. How about changing to 150 ms after the lastwheel
event which made a difference, so thatwheel
events which were ignored because the scale extent has been reached don't count towards the timeout?This would be consistent with the current behaviour of the
start
event (because there is no start even if "already at the corresponding limit of the scale extent.")In my specific use case I have non-linear scaling for certain elements in place in order to e.g. make important lines and symbols still visible at certain zoom levels (think of hinting in typography) but for this I do a costly redrawing of a lot of stuff which is why I only do it at the end of a zoom operation and during the zoom I am only relying on
transform="scale(...)"
. Now with user which are wild with their scroll wheels (or equivalent) and continue scrolling even after the limit has been reached, you get theend
event much later and so they see the results of the smart scaling later.The text was updated successfully, but these errors were encountered: