mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Code review nitpicks
This commit is contained in:
parent
136953aa4e
commit
79742d1b4d
6 changed files with 10 additions and 10 deletions
|
@ -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
|
|||
/// <summary>
|
||||
/// Return the bounds of the Adorner as displayed on the parent Surface
|
||||
/// </summary>
|
||||
protected virtual Rectangle SurfaceBounds
|
||||
protected virtual Rectangle BoundsOnSurface
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue