BUG-1711: Fix for a stacktrace, as something was accessed before it was drawn.

This commit is contained in:
RKrom 2014-12-01 17:21:01 +01:00
parent 089eec769e
commit bba978c209
2 changed files with 11 additions and 6 deletions

View file

@ -290,8 +290,10 @@ namespace Greenshot.Drawing {
}
public virtual void Invalidate() {
if (Status != EditStatus.UNDRAWN) {
_parent.Invalidate(DrawingBounds);
}
}
public void AlignToParent(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) {

View file

@ -133,6 +133,7 @@ namespace Greenshot.Drawing {
/// </summary>
public override Rectangle DrawingBounds {
get {
if (Status != EditStatus.UNDRAWN) {
int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS);
Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);
using (Pen pen = new Pen(lineColor, lineThickness)) {
@ -141,6 +142,8 @@ namespace Greenshot.Drawing {
}
}
}
return Rectangle.Empty;
}
}
/// <summary>