Skip to content
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

Merged
merged 37 commits into from Sep 19, 2022
Merged

Commits on Sep 17, 2022

  1. 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).
    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    b1508b2 View commit details
    Browse the repository at this point in the history
  2. Move calcFreeMem to util

    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    6528840 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    ccd26fc View commit details
    Browse the repository at this point in the history
  4. Let's try w/ 15% of *available* mem

    My napkin math was based on *total* math, so I'll probably bump the
    percentage...
    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    57f4874 View commit details
    Browse the repository at this point in the history
  5. 400% less stupid typos

    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    720b334 View commit details
    Browse the repository at this point in the history
  6. 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...
    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    368ce9c View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    7daa3ca View commit details
    Browse the repository at this point in the history
  8. 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.
    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    525218a View commit details
    Browse the repository at this point in the history
  9. Log when zooming does nothing

    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    1f8bcfd View commit details
    Browse the repository at this point in the history
  10. Update comments

    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    92002e5 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    6870124 View commit details
    Browse the repository at this point in the history
  12. Squish debug

    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    d6a8e24 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    9cffd59 View commit details
    Browse the repository at this point in the history
  14. Attempt to slow down zoom-outs a bit

    It's stupid, but it more or less works, maybe?
    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    9ff9dbb View commit details
    Browse the repository at this point in the history
  15. Zap duplicate comment

    NiLuJe committed Sep 17, 2022
    Copy the full SHA
    d7d7886 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2022

  1. Luacheck'ed

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    68f587d View commit details
    Browse the repository at this point in the history
  2. Comment typo

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    542ab35 View commit details
    Browse the repository at this point in the history
  3. BitOps results are undefined outside of the signed 32 bit range

    Thanks for the reminder, @zwim ;).
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    2af37f1 View commit details
    Browse the repository at this point in the history
  4. Muuuch saner scaling computations for zooms

    Thanks for the shove, @poire-z ;).
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    1b7ecd0 View commit details
    Browse the repository at this point in the history
  5. Hahah, oops.

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    be24c87 View commit details
    Browse the repository at this point in the history
  6. Experiment w/ distance relative to scaled image

    It's... different. And dealing with a factor > 1 for zoom outs is a
    massive PITA.
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    98fbce3 View commit details
    Browse the repository at this point in the history
  7. Revert "Experiment w/ distance relative to scaled image"

    This reverts commit 98fbce3.
    
    Didn't work out.
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    d67cc1b View commit details
    Browse the repository at this point in the history
  8. Debugging

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    badff56 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    45c0a63 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    f0cfdc4 View commit details
    Browse the repository at this point in the history
  11. Eh, not too bad.

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    0a1ec63 View commit details
    Browse the repository at this point in the history
  12. Comment tweak.

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    9fcca4c View commit details
    Browse the repository at this point in the history
  13. More comments

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    b9394fc View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    fde0ba7 View commit details
    Browse the repository at this point in the history
  15. Don't pass subpixel coordinates to base

    Keep as much of the internal shenanigans at full precision, though.
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    70acd1a View commit details
    Browse the repository at this point in the history
  16. That was still stupid ;p.

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    57e7aec View commit details
    Browse the repository at this point in the history
  17. Expand on that comment

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    87e1649 View commit details
    Browse the repository at this point in the history
  18. More comments

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    b71a795 View commit details
    Browse the repository at this point in the history
  19. 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).
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    adc5ad0 View commit details
    Browse the repository at this point in the history
  20. Skip the intermediary scale factor computatio

    As it apparently doesn't make the intent clearer ;).
    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    9c8ae61 View commit details
    Browse the repository at this point in the history
  21. Zap debug

    NiLuJe committed Sep 18, 2022
    Copy the full SHA
    34d7d19 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2022

  1. Review pass

    NiLuJe committed Sep 19, 2022
    Copy the full SHA
    83744b0 View commit details
    Browse the repository at this point in the history