mirror of
https://github.com/greenshot/greenshot.git
synced 2025-03-12 05:25:25 -07:00
Merge branch 'release/1.3' of https://github.com/greenshot/greenshot into release/1.3
This commit is contained in:
commit
ecb1b91ae7
@ -598,9 +598,15 @@ namespace Greenshot.Drawing
|
||||
DrawText(graphics, rect, lineThickness, lineColor, drawShadow, _stringFormat, text, _font);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert the StringFormat information into a TextFormatFlags
|
||||
/// This is important for the rending to work, have it aligned to the correct place
|
||||
/// </summary>
|
||||
/// <param name="stringFormat">StringFormat</param>
|
||||
/// <returns>TextFormatFlags</returns>
|
||||
private static TextFormatFlags ConvertStringFormat(StringFormat stringFormat)
|
||||
{
|
||||
TextFormatFlags flags = TextFormatFlags.Default;
|
||||
var flags = TextFormatFlags.TextBoxControl | TextFormatFlags.WordBreak;
|
||||
if (stringFormat == null)
|
||||
{
|
||||
return flags;
|
||||
@ -683,14 +689,7 @@ namespace Greenshot.Drawing
|
||||
drawingRectange.Inflate(-textOffset, -textOffset);
|
||||
}
|
||||
|
||||
if (stringFormat != null)
|
||||
{
|
||||
TextRenderer.DrawText(graphics, text, font, drawingRectange, fontColor, ConvertStringFormat(stringFormat));
|
||||
}
|
||||
else
|
||||
{
|
||||
TextRenderer.DrawText(graphics, text, font, drawingRectange, fontColor);
|
||||
}
|
||||
TextRenderer.DrawText(graphics, text, font, drawingRectange, fontColor, ConvertStringFormat(stringFormat));
|
||||
}
|
||||
|
||||
public override bool ClickableAt(int x, int y)
|
||||
|
Loading…
x
Reference in New Issue
Block a user