mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
BUG-2213: Fix referencing null freehandPath
This commit is contained in:
parent
498e5ee749
commit
b85f9e66a3
1 changed files with 9 additions and 1 deletions
|
@ -235,14 +235,22 @@ namespace Greenshot.Drawing {
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode() {
|
public override int GetHashCode() {
|
||||||
|
if (freehandPath == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return freehandPath.GetHashCode();
|
return freehandPath.GetHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ClickableAt(int x, int y) {
|
public override bool ClickableAt(int x, int y) {
|
||||||
bool returnValue = base.ClickableAt(x, y);
|
bool returnValue = base.ClickableAt(x, y);
|
||||||
if (returnValue) {
|
if (returnValue) {
|
||||||
|
if (freehandPath == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS);
|
int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS);
|
||||||
using (Pen pen = new Pen(Color.White)) {
|
using (var pen = new Pen(Color.White)) {
|
||||||
pen.Width = lineThickness + 10;
|
pen.Width = lineThickness + 10;
|
||||||
returnValue = freehandPath.IsOutlineVisible(x-Left,y-Top, pen);
|
returnValue = freehandPath.IsOutlineVisible(x-Left,y-Top, pen);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue