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
ImageViewer: Clamp zoom factor to sane values #9529
Commits on Sep 17, 2022
-
ImageViewer: Clamp scale factor to dynamic values when zooming
Should avoid egregious values that would potentially alloc insanely large buffers (and likely fail to do so).
-
-
-
Let's try w/ 15% of *available* mem
My napkin math was based on *total* math, so I'll probably bump the percentage...
-
-
Compute the scaling extrema based on the *image* size, pre-scaling
What we get by the time _render has finished has most likely already been prescaled...
-
-
Only request the zoom extrema once in ImageViewer, since we destroy
ImageWidget Otherwise the max factor gets ever so slightly smaller each time because we eat more memory at higher zoom levels ;). Which makes the final zooming steps confusing as it jitters back and forth.
-
-
-
-
-
-
Attempt to slow down zoom-outs a bit
It's stupid, but it more or less works, maybe?
-
Commits on Sep 18, 2022
-
-
-
BitOps results are undefined outside of the signed 32 bit range
Thanks for the reminder, @zwim ;).
-
Muuuch saner scaling computations for zooms
Thanks for the shove, @poire-z ;).
-
-
Experiment w/ distance relative to scaled image
It's... different. And dealing with a factor > 1 for zoom outs is a massive PITA.
-
Revert "Experiment w/ distance relative to scaled image"
This reverts commit 98fbce3. Didn't work out.
-
-
-
-
-
-
-
Don't pass subpixel coordinates to base
Keep as much of the internal shenanigans at full precision, though.
-
-
-
-
ImageViewer: Make the edge swipes behave similarly as pinch/spreads
Also, update the zone to match GestureManager's *_edge zones. (Which matches how wide my tiny fingers actually are ;p).
-
Skip the intermediary scale factor computatio
As it apparently doesn't make the intent clearer ;).