|
@@ -35,6 +35,21 @@ public partial class ZoomPanel : ContentControl, INotifyPropertyChanged
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public double _minScale = 0.5;
|
|
|
+ public double MinScale
|
|
|
+ {
|
|
|
+ get => _minScale;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ _minScale = value;
|
|
|
+ if(_scale < _minScale)
|
|
|
+ {
|
|
|
+ Scale = _minScale;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public double _scale = 1;
|
|
|
public double Scale
|
|
|
{
|
|
@@ -149,7 +164,7 @@ public partial class ZoomPanel : ContentControl, INotifyPropertyChanged
|
|
|
Scale /= 1 + (-e.Delta) * WheelSpeed;
|
|
|
}
|
|
|
|
|
|
- Scale = Math.Max(Scale, 0.5);
|
|
|
+ Scale = Math.Max(MinScale, Scale);
|
|
|
|
|
|
var scaledPos = new Point(contentMPos.X * Scale, contentMPos.Y * Scale);
|
|
|
var offset = scaledPos - pos;
|