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

Max/Min Zoom Constraint Issues with mouse wheel zoom #80

Closed
Slazanger opened this issue Sep 1, 2024 · 1 comment
Closed

Max/Min Zoom Constraint Issues with mouse wheel zoom #80

Slazanger opened this issue Sep 1, 2024 · 1 comment

Comments

@Slazanger
Copy link

The mousewheel causes a translation when at max zooms rather than doing nothing :

Repo :

  1. In the sample app set a min & max zoom to 0.2 & 2.0
  2. Start the sample, enable constraints
  3. Continue to zoom in using the mouse wheel, when the max zoom is reached the controls will move unexpectedly
@SiMet
Copy link
Contributor

SiMet commented Oct 17, 2024

The fix for this is to add code:

        if((ZoomX >= MaxZoomX && ZoomY >= MaxZoomY && ratio > 1) || (ZoomX <= MinZoomX && ZoomY <= MinZoomY && ratio < 1))
        {
            return;
        }

To ZoomBorder.cs, method ZoomTo before _updating = true

SiMet added a commit to SiMet/PanAndZoom that referenced this issue Oct 17, 2024
Do not change _matrix when zooming reached the max/min values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants