Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-11-07 10:34:50 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-11-07 10:41:38 +0300
commit469005f1f6ade2d3d403fae4531afdd3da55cd96 (patch)
treea968c7dd2b99369e68a65a6ccdd62ac00a38230d /source/blender/editors/animation/keyframes_draw.c
parent03e5ba31837cbe91b633e18f19ba0b08e070e0dc (diff)
Dopesheet: correctly use floating point threshold in ActKeyColumn tree.
After some thinking, since the tree itself does always use floating point numbers, it is better to use the threshold - but correctly.
Diffstat (limited to 'source/blender/editors/animation/keyframes_draw.c')
-rw-r--r--source/blender/editors/animation/keyframes_draw.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 09f81042a47..5ad10b3cf84 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -245,15 +245,10 @@ 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;
- if (gpf->framenum < ak->cfra)
- return -1;
- else if (gpf->framenum > ak->cfra)
- return 1;
- else
- return 0;
+ float frame = gpf->framenum;
+ return compare_ak_cfraPtr(node, &frame);
}
/* New node callback used for building ActKeyColumns from GPencil frames */
@@ -295,15 +290,10 @@ 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;
- if (masklay_shape->frame < ak->cfra)
- return -1;
- else if (masklay_shape->frame > ak->cfra)
- return 1;
- else
- return 0;
+ float frame = masklay_shape->frame;
+ return compare_ak_cfraPtr(node, &frame);
}
/* New node callback used for building ActKeyColumns from GPencil frames */