1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

follow Micropython conventions with anim->get_value_cb

This commit is contained in:
Gabor Kiss-Vamosi 2021-03-25 20:09:51 +01:00
parent 966f6e1727
commit b3f1d49735
2 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ void lv_anim_start(lv_anim_t * a)
/*Set the start value*/
if(new_anim->early_apply) {
if(new_anim->get_value_cb) {
int32_t v_ofs = new_anim->get_value_cb(a->var);
int32_t v_ofs = new_anim->get_value_cb(a);
new_anim->start_value += v_ofs;
new_anim->end_value += v_ofs;
}
@ -468,7 +468,7 @@ static void anim_timer(lv_timer_t * param)
int32_t new_act_time = a->act_time + elaps;
if(a->act_time <= 0 && new_act_time >= 0) {
if(a->early_apply == 0 && a->get_value_cb) {
int32_t v_ofs = a->get_value_cb(a->var);
int32_t v_ofs = a->get_value_cb(a);
a->start_value += v_ofs;
a->end_value += v_ofs;
}

View File

@ -64,7 +64,7 @@ typedef void (*lv_anim_ready_cb_t)(struct _lv_anim_t *);
typedef void (*lv_anim_start_cb_t)(struct _lv_anim_t *);
/** Callback used when the animation values are relative to get the current value*/
typedef int32_t (*lv_anim_get_value_cb_t)(void *);
typedef int32_t (*lv_anim_get_value_cb_t)(struct _lv_anim_t *);
/** Describes an animation*/
typedef struct _lv_anim_t {