Skip to content

Commit

Permalink
Merge pull request #81 from SiMet/patch-1
Browse files Browse the repository at this point in the history
Do not change _matrix when zooming reached the max/min values
  • Loading branch information
wieslawsoltes authored Oct 31, 2024
2 parents 60d1ca1 + 230c2cb commit 6008600
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Avalonia.Controls.PanAndZoom/ZoomBorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@ public void ZoomTo(double ratio, double x, double y, bool skipTransitions = fals
{
return;
}

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

_updating = true;

Log("[ZoomTo]");
Expand Down

0 comments on commit 6008600

Please sign in to comment.