diff --git a/Greenshot/Drawing/Adorners/AbstractAdorner.cs b/Greenshot/Drawing/Adorners/AbstractAdorner.cs index 51ae7f14f..70a56f29e 100644 --- a/Greenshot/Drawing/Adorners/AbstractAdorner.cs +++ b/Greenshot/Drawing/Adorners/AbstractAdorner.cs @@ -1,4 +1,4 @@ -/* +/* * Greenshot - a free and open source screenshot tool * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom * @@ -119,7 +119,7 @@ namespace Greenshot.Drawing.Adorners /// /// Return the bounds of the Adorner as displayed on the parent Surface /// - protected virtual Rectangle SurfaceBounds + protected virtual Rectangle BoundsOnSurface { get { diff --git a/Greenshot/Drawing/Adorners/MoveAdorner.cs b/Greenshot/Drawing/Adorners/MoveAdorner.cs index 21c42a9fa..d07a25ef7 100644 --- a/Greenshot/Drawing/Adorners/MoveAdorner.cs +++ b/Greenshot/Drawing/Adorners/MoveAdorner.cs @@ -142,7 +142,7 @@ namespace Greenshot.Drawing.Adorners { Graphics targetGraphics = paintEventArgs.Graphics; - var bounds = SurfaceBounds; + var bounds = BoundsOnSurface; GraphicsState state = targetGraphics.Save(); targetGraphics.SmoothingMode = SmoothingMode.None; diff --git a/Greenshot/Drawing/Adorners/ResizeAdorner.cs b/Greenshot/Drawing/Adorners/ResizeAdorner.cs index ef61b17bc..dce78b461 100644 --- a/Greenshot/Drawing/Adorners/ResizeAdorner.cs +++ b/Greenshot/Drawing/Adorners/ResizeAdorner.cs @@ -169,7 +169,7 @@ namespace Greenshot.Drawing.Adorners { Graphics targetGraphics = paintEventArgs.Graphics; - var bounds = SurfaceBounds; + var bounds = BoundsOnSurface; GraphicsState state = targetGraphics.Save(); targetGraphics.SmoothingMode = SmoothingMode.None; diff --git a/Greenshot/Drawing/Adorners/TargetAdorner.cs b/Greenshot/Drawing/Adorners/TargetAdorner.cs index 4011754f7..67c01a533 100644 --- a/Greenshot/Drawing/Adorners/TargetAdorner.cs +++ b/Greenshot/Drawing/Adorners/TargetAdorner.cs @@ -1,4 +1,4 @@ -/* +/* * Greenshot - a free and open source screenshot tool * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom * @@ -96,7 +96,7 @@ namespace Greenshot.Drawing.Adorners { Graphics targetGraphics = paintEventArgs.Graphics; - var bounds = SurfaceBounds; + var bounds = BoundsOnSurface; targetGraphics.FillRectangle(Brushes.Green, bounds.X, bounds.Y, bounds.Width, bounds.Height); } diff --git a/Greenshot/Drawing/CropContainer.cs b/Greenshot/Drawing/CropContainer.cs index f5288074d..58cee17b1 100644 --- a/Greenshot/Drawing/CropContainer.cs +++ b/Greenshot/Drawing/CropContainer.cs @@ -61,7 +61,7 @@ namespace Greenshot.Drawing { if (_parent?.Image is Image image) { return new Rectangle(0, 0, image.Width, image.Height); } else { - return new Rectangle(); + return Rectangle.Empty; } } } diff --git a/Greenshot/Drawing/Surface.cs b/Greenshot/Drawing/Surface.cs index 0057a0838..3d1f309a3 100644 --- a/Greenshot/Drawing/Surface.cs +++ b/Greenshot/Drawing/Surface.cs @@ -1,4 +1,4 @@ -/* +/* * Greenshot - a free and open source screenshot tool * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom * @@ -1405,7 +1405,7 @@ namespace Greenshot.Drawing return GetImage(RenderMode.EXPORT); } - private Rectangle ZoomClipRectangle(Rectangle rc, double scale) + private static Rectangle ZoomClipRectangle(Rectangle rc, double scale) => new Rectangle( (int)(rc.X * scale), (int)(rc.Y * scale), @@ -1413,7 +1413,7 @@ namespace Greenshot.Drawing (int)((rc.Height + 1) * scale) + 1 ); - private RectangleF ZoomClipRectangle(RectangleF rc, double scale) + private static RectangleF ZoomClipRectangle(RectangleF rc, double scale) => new RectangleF( (float)Math.Floor(rc.X * scale), (float)Math.Floor(rc.Y * scale),