From 5e7b5162d9b118387f6a9a33b4e758a27d9a269d Mon Sep 17 00:00:00 2001 From: Julien Richard Date: Sat, 26 Aug 2023 18:29:48 +0200 Subject: [PATCH] Fix diff for ScaleHelper --- src/Greenshot.Editor/Helpers/ScaleHelper.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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