From 27d28efbebaa6d987a67a068282d6904de6e9be8 Mon Sep 17 00:00:00 2001 From: JKlingen Date: Mon, 30 Jan 2012 22:22:38 +0000 Subject: [PATCH] fixed warning because of setting a ScaleOptions var to 0x0 git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1612 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Helpers/ScaleHelper.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Greenshot/Helpers/ScaleHelper.cs b/Greenshot/Helpers/ScaleHelper.cs index 249b13b8a..d0173b365 100644 --- a/Greenshot/Helpers/ScaleHelper.cs +++ b/Greenshot/Helpers/ScaleHelper.cs @@ -31,6 +31,10 @@ namespace Greenshot.Helpers { [Flags] public enum ScaleOptions { + /// + /// Default scale behavior. + /// + Default = 0x00, /// /// Scale a rectangle in two our four directions, mirrored at it's center coordinates /// @@ -123,7 +127,7 @@ namespace Greenshot.Helpers { } public static void Scale(ref RectangleF originalRectangle, int resizeHandlePosition, PointF resizeHandleCoords) { - Scale(ref originalRectangle, resizeHandlePosition, resizeHandleCoords, 0x0); + Scale(ref originalRectangle, resizeHandlePosition, resizeHandleCoords, null); } /// @@ -133,7 +137,7 @@ namespace Greenshot.Helpers { /// position of the handle/gripper being used for resized, see constants in Gripper.cs, e.g. Gripper.POSITION_TOP_LEFT /// coordinates of the used handle/gripper /// ScaleOptions to use when scaling - public static void Scale(ref RectangleF originalRectangle, int resizeHandlePosition, PointF resizeHandleCoords, ScaleOptions options) { + public static void Scale(ref RectangleF originalRectangle, int resizeHandlePosition, PointF resizeHandleCoords, ScaleOptions? options) { if(options == null) { options = GetScaleOptions(); } @@ -319,9 +323,9 @@ namespace Greenshot.Helpers { public static ScaleHelper.ScaleOptions GetScaleOptions() { bool anchorAtCenter = (Control.ModifierKeys & Keys.Control) != 0; bool maintainAspectRatio = ((Control.ModifierKeys & Keys.Shift) != 0); - ScaleHelper.ScaleOptions opts = 0x0; - if(anchorAtCenter) opts |= ScaleHelper.ScaleOptions.Centered; - if(maintainAspectRatio) opts |= ScaleHelper.ScaleOptions.Rational; + ScaleOptions opts = ScaleOptions.Default; + if(anchorAtCenter) opts |= ScaleOptions.Centered; + if(maintainAspectRatio) opts |= ScaleOptions.Rational; return opts; }