Skip to content

Commit

Permalink
Fix for #80
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
SiMet authored Oct 17, 2024
1 parent 60d1ca1 commit 230c2cb
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 230c2cb

Please sign in to comment.