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,7 +290,9 @@ namespace Greenshot.Drawing {
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Invalidate() {
|
public virtual void Invalidate() {
|
||||||
_parent.Invalidate(DrawingBounds);
|
if (Status != EditStatus.UNDRAWN) {
|
||||||
|
_parent.Invalidate(DrawingBounds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AlignToParent(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) {
|
public void AlignToParent(HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment) {
|
||||||
|
|
|
@ -133,13 +133,16 @@ namespace Greenshot.Drawing {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override Rectangle DrawingBounds {
|
public override Rectangle DrawingBounds {
|
||||||
get {
|
get {
|
||||||
int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS);
|
if (Status != EditStatus.UNDRAWN) {
|
||||||
Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);
|
int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS);
|
||||||
using (Pen pen = new Pen(lineColor, lineThickness)) {
|
Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);
|
||||||
using (GraphicsPath tailPath = CreateTail()) {
|
using (Pen pen = new Pen(lineColor, lineThickness)) {
|
||||||
return Rectangle.Inflate(Rectangle.Union(Rectangle.Round(tailPath.GetBounds(new Matrix(), pen)),GuiRectangle.GetGuiRectangle(Left, Top, Width, Height)), lineThickness+2, lineThickness+2);
|
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.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue