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:
authorJeroen Bakker <jeroen@blender.org>2021-08-06 10:46:36 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-06 10:46:36 +0300
commit1ab75c1d494422270fa88bbf23cc42f7b203ed4b (patch)
treec70f4ef4118deb6efe01477438bddf800f503560 /source/blender/editors/animation
parentbb8ce95b5ee79787d0a54cb59f522726d693dc7d (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.c9
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;
}
}