From ea8e2d35cc14867a722b9d559cc368b17ef8ac6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8A=BC?= Date: Mon, 3 Jun 2024 16:15:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Ursa/Controls/ImageViewer/ImageViewer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Ursa/Controls/ImageViewer/ImageViewer.cs b/src/Ursa/Controls/ImageViewer/ImageViewer.cs index 557f90a..dd4de17 100644 --- a/src/Ursa/Controls/ImageViewer/ImageViewer.cs +++ b/src/Ursa/Controls/ImageViewer/ImageViewer.cs @@ -193,11 +193,6 @@ public class ImageViewer: TemplatedControl private void OnMinScaleChanged(AvaloniaPropertyChangedEventArgs args) { - var newMinScale = args.GetNewValue(); - if (newMinScale > Scale) - { - Scale = newMinScale; - } if (_image is { }) { _sourceMinScale = Math.Min(Width * MinScale / _image.Width, Height * MinScale / _image.Height); @@ -206,6 +201,11 @@ public class ImageViewer: TemplatedControl { _sourceMinScale = MinScale; } + + if (_sourceMinScale > Scale) + { + Scale = _sourceMinScale; + } } private double GetScaleRatio(double widthRatio, double heightRatio, Stretch stretch)