diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-09 02:07:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-09 02:07:57 +0400 |
commit | c96c63ad3afe66e04d7a2f7c351abbc53242f03a (patch) | |
tree | b81212c343dc7d5b4a293b29e1fb18132da4766c /source/blender/editors/gpencil | |
parent | a8e0011c96c6bbf60e79911f870b25384e06f60d (diff) |
add a utility function to get an exact match for a grease pencil frame.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/editaction_gpencil.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index 262ae13ece3..a7beaa74eb7 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -181,14 +181,11 @@ void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode) if (gpl == NULL) return; - - /* search through frames for a match */ - for (gpf = gpl->frames.first; gpf; gpf = gpf->next) { - /* there should only be one frame with this frame-number */ - if (gpf->framenum == selx) { - gpframe_select(gpf, select_mode); - break; - } + + gpf = BKE_gpencil_layer_find_frame(gpl, selx); + + if (gpf) { + gpframe_select(gpf, select_mode); } } |