From 100ad04059321bf0d6bf1e1409969c9baaea1f8e Mon Sep 17 00:00:00 2001 From: RKrom Date: Thu, 4 Dec 2014 17:06:34 +0100 Subject: [PATCH] Fix the invalidate rectangle size, which causes graphics artifacts when moving it around. --- Greenshot/Drawing/SpeechbubbleContainer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Greenshot/Drawing/SpeechbubbleContainer.cs b/Greenshot/Drawing/SpeechbubbleContainer.cs index 74090869d..64ede51e8 100644 --- a/Greenshot/Drawing/SpeechbubbleContainer.cs +++ b/Greenshot/Drawing/SpeechbubbleContainer.cs @@ -132,9 +132,11 @@ namespace Greenshot.Drawing { if (Status != EditStatus.UNDRAWN) { int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS); Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR); + bool shadow = GetFieldValueAsBool(FieldType.SHADOW); using (Pen pen = new Pen(lineColor, lineThickness)) { + int inflateValue = lineThickness + 2 + (shadow ? 6 : 0); using (GraphicsPath tailPath = CreateTail()) { - return Rectangle.Inflate(Rectangle.Union(Rectangle.Round(tailPath.GetBounds(new Matrix(), pen)), GuiRectangle.GetGuiRectangle(Left, Top, Width, Height)), lineThickness + 2, lineThickness + 2); + return Rectangle.Inflate(Rectangle.Union(Rectangle.Round(tailPath.GetBounds(new Matrix(), pen)), GuiRectangle.GetGuiRectangle(Left, Top, Width, Height)), inflateValue, inflateValue); } } }