diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-06 22:31:57 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-06 22:36:10 +0300 |
commit | 5c18393c8ee9d72e1fe5e8fc6edac569d0a4f13a (patch) | |
tree | ee9a99c075f4f84a23491b3be026bd183ca4aa34 /source/blender/editors/animation/keyframes_draw.c | |
parent | ad248333a6f844ccee8ea7788b8dd3d8c2979ef8 (diff) |
Fix T57656: Keyframes cannot be selected in Grease Pencil Dopesheet.
Partial revert of rBf250f9256e065: GP and masks use integer
frames, so float code isn't working or even needed.
Diffstat (limited to 'source/blender/editors/animation/keyframes_draw.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 3eb73b9eef2..09f81042a47 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -245,9 +245,15 @@ static void nupdate_ak_bezt(void *node, void *data) /* Comparator callback used for ActKeyColumns and GPencil frame */ static short compare_ak_gpframe(void *node, void *data) { + ActKeyColumn *ak = (ActKeyColumn *)node; bGPDframe *gpf = (bGPDframe *)data; - return compare_ak_cfraPtr(node, &gpf->framenum); + if (gpf->framenum < ak->cfra) + return -1; + else if (gpf->framenum > ak->cfra) + return 1; + else + return 0; } /* New node callback used for building ActKeyColumns from GPencil frames */ @@ -289,9 +295,15 @@ static void nupdate_ak_gpframe(void *node, void *data) /* Comparator callback used for ActKeyColumns and GPencil frame */ static short compare_ak_masklayshape(void *node, void *data) { + ActKeyColumn *ak = (ActKeyColumn *)node; MaskLayerShape *masklay_shape = (MaskLayerShape *)data; - return compare_ak_cfraPtr(node, &masklay_shape->frame); + if (masklay_shape->frame < ak->cfra) + return -1; + else if (masklay_shape->frame > ak->cfra) + return 1; + else + return 0; } /* New node callback used for building ActKeyColumns from GPencil frames */ |