mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 03:30:02 -07:00
BUG-1711: Fix for a stacktrace, as something was accessed before it was drawn.
This commit is contained in:
parent
089eec769e
commit
bba978c209
2 changed files with 11 additions and 6 deletions
|
@ -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) {
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue