Fix the invalidate rectangle size, which causes graphics artifacts when moving it around.

This commit is contained in:
RKrom 2014-12-04 17:06:34 +01:00
commit 100ad04059

View file

@ -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);
}
}
}