diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-08-06 10:46:36 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-08-06 10:46:36 +0300 |
commit | 1ab75c1d494422270fa88bbf23cc42f7b203ed4b (patch) | |
tree | c70f4ef4118deb6efe01477438bddf800f503560 /source/blender/editors/animation | |
parent | bb8ce95b5ee79787d0a54cb59f522726d693dc7d (diff) |
Cleanup: use range2f in `ED_keylist_find_any_between`.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframes_keylist.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/animation/keyframes_keylist.c b/source/blender/editors/animation/keyframes_keylist.c index 722edba0473..a869d8d6388 100644 --- a/source/blender/editors/animation/keyframes_keylist.c +++ b/source/blender/editors/animation/keyframes_keylist.c @@ -89,14 +89,11 @@ ActKeyColumn *ED_keylist_find_prev(const AnimKeylist *keylist, float cfra) /* TODO(jbakker): Should we change this to use `ED_keylist_find_next(keys, min_fra)` and only check * boundary of `max_fra`. */ -/* TODO(jbakker): Use const Range2f. */ -ActKeyColumn *ED_keylist_find_any_between(const AnimKeylist *keylist, - const float min_fra, - const float max_fra) +ActKeyColumn *ED_keylist_find_any_between(const AnimKeylist *keylist, const Range2f frame_range) { for (ActKeyColumn *ak = keylist->keys.root; ak; - ak = (ak->cfra < min_fra) ? ak->right : ak->left) { - if (IN_RANGE(ak->cfra, min_fra, max_fra)) { + ak = (ak->cfra < frame_range.min) ? ak->right : ak->left) { + if (range2f_in_range(&frame_range, ak->cfra)) { return ak; } } |