mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fix for size calculations, an exception occured when the size is negative.
This commit is contained in:
parent
e75925018b
commit
5a96d6f3eb
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue