Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lv_anim_t's completed_cb is not called anymore when no exec_cb is set and used with anim_timeline #6876

Open
Viatorus opened this issue Sep 18, 2024 · 2 comments

Comments

@Viatorus
Copy link
Contributor

LVGL version

9.2.0

What happened?

The behavior changed from 8.x to 9.x.

In 8.x a virtual exec_cb was set in case of an absent exec_cb:

/*Add default var and virtual exec_cb, used to delete animation.*/
if(a->var == NULL && a->exec_cb == NULL) {
at->anim_dsc[at->anim_dsc_cnt - 1].anim.var = at;
at->anim_dsc[at->anim_dsc_cnt - 1].anim.exec_cb = lv_anim_timeline_virtual_exec_cb;
}

In 9.x not anymore:
https://github.com/lvgl/lvgl/blame/a89cda10c103276d9efde6d5a3b3e68eaa159324/src/misc/lv_anim_timeline.c#L76C6-L76C26

So the animation is never started here:

if(a->exec_cb == NULL && a->custom_exec_cb == NULL) {
continue;
}

How to reproduce?

No response

@Viatorus Viatorus changed the title lv_anim_t's completed_cb is not called anymore with no exec_cb is set and used with anim_timeline lv_anim_t's completed_cb is not called anymore when no exec_cb is set and used with anim_timeline Sep 18, 2024
@Viatorus
Copy link
Contributor Author
Viatorus commented Sep 18, 2024

A quick solution could be reintroduction of lv_anim_timeline_virtual_exec_cb.

A better solution, but with major changes, might be to make anim_timeline_set_act_time work with exec_cb == null.

If the first solution is okay for you, I could add an PR.

@kisvegabor
Copy link
Member

Hey,

I haven't tested it but it seems

        if(a->exec_cb == NULL && a->custom_exec_cb == NULL) {
            continue;
        }

can be removed as, below it's checked if exec_cb or custom_exec_cb are NULL before calling them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants