From 5c18393c8ee9d72e1fe5e8fc6edac569d0a4f13a Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Tue, 6 Nov 2018 22:31:57 +0300 Subject: 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. --- source/blender/editors/animation/keyframes_draw.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/animation/keyframes_draw.c') 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 */ -- cgit v1.2.3