From 5a96d6f3ebb1119612834d74e406742e9154e4d5 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 3 Jun 2014 12:42:01 +0200 Subject: [PATCH] Fix for size calculations, an exception occured when the size is negative. --- Greenshot/Drawing/StepLabelContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Greenshot/Drawing/StepLabelContainer.cs b/Greenshot/Drawing/StepLabelContainer.cs index 9df464a74..a75faf1d1 100644 --- a/Greenshot/Drawing/StepLabelContainer.cs +++ b/Greenshot/Drawing/StepLabelContainer.cs @@ -118,7 +118,7 @@ namespace Greenshot.Drawing { EllipseContainer.DrawEllipse(rect, graphics, rm, 0, Color.Transparent, fillColor, false); } using (FontFamily fam = new FontFamily(FontFamily.GenericSansSerif.Name)) { - float factor = (((float)Width / DefaultSize.Width) + ((float)Height / DefaultSize.Height)) / 2; + float factor = (((float)rect.Width / DefaultSize.Width) + ((float)rect.Height / DefaultSize.Height)) / 2; _font = new Font(fam, 16 * factor, FontStyle.Bold, GraphicsUnit.Pixel); TextContainer.DrawText(graphics, rect, 0, lineColor, false, _stringFormat, text, _font); }