diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 01:23:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 01:23:02 +0400 |
commit | 613f464c51fbaa759e45b8b22ede47c8aea9382f (patch) | |
tree | 07ba28ad38668fc0e6f02d77bdc41e8098e6114d /source/blender/editors/gpencil | |
parent | 7413ab8f1f4521f3ae2828cb0aa3bbf3bc1c0e2a (diff) |
fix [#31427] Crash when undoing until no point in grease pencil poly mode
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b79c510efce..628f3aefa77 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -321,7 +321,12 @@ static short gp_stroke_addpoint(tGPsdata *p, const int mval[2], float pressure) { bGPdata *gpd = p->gpd; tGPspoint *pt; - + + /* sanity check, can happen after undo [#31427] */ + if (p->flags & GP_PAINTFLAG_STROKEADDED && p->gpf->strokes.last == NULL) { + p->flags &= ~GP_PAINTFLAG_STROKEADDED; + } + /* check painting mode */ if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) { /* straight lines only - i.e. only store start and end point in buffer */ |