wieslawsoltes / PanAndZoom

Pan and zoom control for Avalonia.
http://wieslawsoltes.github.io/PanAndZoom/
MIT License
345 stars 45 forks source link

Bug: some move after reaching max or min zoom #36

Closed RomanSoloweow closed 4 years ago

RomanSoloweow commented 4 years ago

After reaching max or min zoom on MouseWheel we have some translate for our elements.

I think this is because we continue to set CenterX and CenterY for ScaleTransform after reaching max or min.

We need just block it if zoom value already max or min.

wieslawsoltes commented 4 years ago

You can set property EnableConstrains=true and set properties for required zoom limits MinZoomX, MaxZoomX, MinZoomY , MaxZoomY.

https://github.com/wieslawsoltes/PanAndZoom/blob/e414b2ac5b41b8cc35fcb9ee70dd511e583750d8/src/PanAndZoom/IPanAndZoom.cs#L59

https://github.com/wieslawsoltes/PanAndZoom/blob/e414b2ac5b41b8cc35fcb9ee70dd511e583750d8/src/PanAndZoom/IPanAndZoom.cs#L61-L79

SCLDGit commented 2 years ago

I think you misunderstood this issue. When MinZoom is set for X and Y, if you keep trying to zoom out after reaching the min zoom, it will pan the view in an undefined way

Joaoo1 commented 7 months ago

I am still having the same problem, when reaches the MaxZoom, if i keep trying to zoom in, it will pan to another place.

I already setted the property EnableConstrains=true and the properties MinZoomX, MaxZoomX, MinZoomY, MaxZoomY.