Skip to content

Commit

Permalink
Fix exception when rotating when counter are used, by prevent negativ…
Browse files Browse the repository at this point in the history
…e fontsize (greenshot#382)
  • Loading branch information
Christian-Schulz authored Feb 19, 2022
1 parent 2e13c57 commit a32cc18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Greenshot.Editor/Drawing/StepLabelContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public override void Draw(Graphics graphics, RenderMode rm)
EllipseContainer.DrawEllipse(rect, graphics, rm, 0, Color.Transparent, fillColor, false);
}

float fontSize = Math.Min(Width, Height) / 1.4f;
float fontSize = Math.Min(Math.Abs(Width), Math.Abs(Height)) / 1.4f;
using FontFamily fam = new FontFamily(FontFamily.GenericSansSerif.Name);
using Font font = new Font(fam, fontSize, FontStyle.Bold, GraphicsUnit.Pixel);
TextContainer.DrawText(graphics, rect, 0, lineColor, false, _stringFormat, text, font);
Expand Down

0 comments on commit a32cc18

Please sign in to comment.