From 43b7dac427a6faa09ab5d7c9a47690a0a5ae168f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 16 Apr 2014 03:22:02 +1200 Subject: Use binary search threshold when deciding whether to create ActKeyColumns too... --- source/blender/editors/animation/keyframes_draw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 4dc3b1701ee..3f7e9212e5d 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -86,10 +86,14 @@ short compare_ak_cfraPtr(void *node, void *data) { ActKeyColumn *ak = (ActKeyColumn *)node; float *cframe = data; + float val = *cframe; + + if (IS_EQT(val, ak->cfra, BEZT_BINARYSEARCH_THRESH)) + return 0; - if (*cframe < ak->cfra) + if (val < ak->cfra) return -1; - else if (*cframe > ak->cfra) + else if (val > ak->cfra) return 1; else return 0; -- cgit v1.2.3