follow Micropython conventions with anim->get_value_cb
This commit is contained in:
@@ -115,7 +115,7 @@ void lv_anim_start(lv_anim_t * a)
|
|||||||
/*Set the start value*/
|
/*Set the start value*/
|
||||||
if(new_anim->early_apply) {
|
if(new_anim->early_apply) {
|
||||||
if(new_anim->get_value_cb) {
|
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->start_value += v_ofs;
|
||||||
new_anim->end_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;
|
int32_t new_act_time = a->act_time + elaps;
|
||||||
if(a->act_time <= 0 && new_act_time >= 0) {
|
if(a->act_time <= 0 && new_act_time >= 0) {
|
||||||
if(a->early_apply == 0 && a->get_value_cb) {
|
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->start_value += v_ofs;
|
||||||
a->end_value += v_ofs;
|
a->end_value += v_ofs;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 *);
|
typedef void (*lv_anim_start_cb_t)(struct _lv_anim_t *);
|
||||||
|
|
||||||
/** Callback used when the animation values are relative to get the current value*/
|
/** 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*/
|
/** Describes an animation*/
|
||||||
typedef struct _lv_anim_t {
|
typedef struct _lv_anim_t {
|
||||||
|
|||||||
Reference in New Issue
Block a user