#10 Zoom Can Go negative

v1.0_(example)
closed-fixed
None
5
2014-02-19
2014-02-12
Ben Supnik
No

Zoom goes negative on an aggressive scroll-wheel - please note that I repro this on a Microsoft intelli-mouse, with the "chunky" mouse wheel, not some fancy Apple mouse with really fine-grained 2-d scrolling!

The negative-zoom on scroll-wheel bug is due to these two lines of code in the scroll wheel handler (LDrawGLView.m:1957 roughly)

CGFloat magnification = [theEvent deltaY] / 20; // 1 = increase 100%; -1 = decrease 100%
CGFloat zoomChange = 1.0 + magnification;

If the single-scroll delta is <= -20, the zoom change fraction can be <= 0 and we get hosed.

I think correct handling would be to convert magnification from a linear distance to a ratio via a logarithm function.

Anyway, if you have strong feelings about how zoom should 'feel', you should probably poke at this yourself. Or punt it back to me and I can "fix" it. :-)

Discussion

  • Allen Smith

    Allen Smith - 2014-02-18
    • assigned_to: Allen Smith --> Ben Supnik
     
  • Allen Smith

    Allen Smith - 2014-02-18

    I changed the magnification function to prevent it from generating negative numbers. The old LDraw renderer code guarded against this bug by disallowing zoom percentages less than 1%. That guard got lost in LDrawCamera, and I would like to have it back if that's possible.

     
  • Ben Supnik

    Ben Supnik - 2014-02-19
    • status: open --> closed-fixed
     
  • Ben Supnik

    Ben Supnik - 2014-02-19

    fixed with SVN r648. Tested with mouse, pinch zoom and zoom-out tool in both walk-through and 3-d perspectives.

     
    Last edit: Ben Supnik 2014-02-19

Log in to post a comment.