diff --git a/src/Greenshot.Editor/Helpers/ScaleHelper.cs b/src/Greenshot.Editor/Helpers/ScaleHelper.cs index ab489889e..8e4a76a13 100644 --- a/src/Greenshot.Editor/Helpers/ScaleHelper.cs +++ b/src/Greenshot.Editor/Helpers/ScaleHelper.cs @@ -33,7 +33,7 @@ namespace Greenshot.Editor.Helpers /// public static class ScaleHelper { - /// + /// /// calculates the Size an element must be resized to, in order to fit another element, keeping aspect ratio /// /// the size of the element to be resized @@ -215,14 +215,15 @@ namespace Greenshot.Editor.Helpers /// int /// int /// IDoubleProcessor - /// ScaleOptionsProcessor + /// ScaleOptions /// NativeRectFloat - public static NativeRectFloat Scale(NativeRect boundsBeforeResize, int cursorX, int cursorY, IDoubleProcessor angleRoundBehavior, ScaleOptions? options = null) + public static NativeRectFloat Scale(NativeRect boundsBeforeResize, int cursorX, int cursorY, IDoubleProcessor angleRoundBehavior, ScaleOptions? scaleOptions = null) { - options ??= GetScaleOptions(); + scaleOptions ??= GetScaleOptions(); + NativeRectFloat result = boundsBeforeResize; - bool rationalScale = (options & ScaleOptions.Rational) == ScaleOptions.Rational; - bool centeredScale = (options & ScaleOptions.Centered) == ScaleOptions.Centered; + bool rationalScale = (scaleOptions & ScaleOptions.Rational) == ScaleOptions.Rational; + bool centeredScale = (scaleOptions & ScaleOptions.Centered) == ScaleOptions.Centered; if (rationalScale) { @@ -260,5 +261,5 @@ namespace Greenshot.Editor.Helpers if (maintainAspectRatio) opts |= ScaleOptions.Rational; return opts; } - } + } } \ No newline at end of file