diff options
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 42e146301a2..232ee335fbb 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -58,13 +58,11 @@ /* --------- Memory Management ------------ */ /* Free strokes belonging to a gp-frame */ -void free_gpencil_strokes(bGPDframe *gpf) +bool free_gpencil_strokes(bGPDframe *gpf) { bGPDstroke *gps, *gpsn; - - /* error checking */ - if (gpf == NULL) return; - + bool changed = (gpf->strokes.first != NULL); + /* free strokes */ for (gps = gpf->strokes.first; gps; gps = gpsn) { gpsn = gps->next; @@ -73,6 +71,8 @@ void free_gpencil_strokes(bGPDframe *gpf) if (gps->points) MEM_freeN(gps->points); BLI_freelinkN(&gpf->strokes, gps); } + + return changed; } /* Free all of a gp-layer's frames */ @@ -467,16 +467,20 @@ bGPDframe *gpencil_layer_getframe(bGPDlayer *gpl, int cframe, short addnew) } /* delete the given frame from a layer */ -void gpencil_layer_delframe(bGPDlayer *gpl, bGPDframe *gpf) +bool gpencil_layer_delframe(bGPDlayer *gpl, bGPDframe *gpf) { + bool changed = false; + /* error checking */ if (ELEM(NULL, gpl, gpf)) - return; + return false; /* free the frame and its data */ - free_gpencil_strokes(gpf); + changed = free_gpencil_strokes(gpf); BLI_freelinkN(&gpl->frames, gpf); gpl->actframe = NULL; + + return changed; } /* get the active gp-layer for editing */ |