feat(anim) remove lv_anim_path_t and use a callback directly
lv_anim_path_t was required for the MicroPython binding becase the callback couldn't attached dircetly to the styles However, in v8, path_cb is used in the style transitons which has user_data and that user data is passed to the transition animation. Hence the path_cb sees the the same user data during the animaton as when it was registered to the transiton.
This commit is contained in:
@@ -238,8 +238,12 @@ static void draw_indic(lv_event_t * e)
|
||||
|
||||
const lv_area_t * clip_area = lv_event_get_param(e);
|
||||
|
||||
lv_coord_t barw = lv_obj_get_width(obj);
|
||||
lv_coord_t barh = lv_obj_get_height(obj);
|
||||
lv_area_t bar_coords;
|
||||
lv_area_zoom(lv_obj_get_style_transform_zoom(obj, LV_PART_MAIN), &obj->coords, &bar_coords);
|
||||
lv_obj_get_coords(obj, &bar_coords);
|
||||
|
||||
lv_coord_t barw = lv_area_get_width(&bar_coords);
|
||||
lv_coord_t barh = lv_area_get_height(&bar_coords);
|
||||
int32_t range = bar->max_value - bar->min_value;
|
||||
bool hor = barw >= barh ? true : false;
|
||||
bool sym = false;
|
||||
@@ -252,7 +256,7 @@ static void draw_indic(lv_event_t * e)
|
||||
lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN);
|
||||
lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN);
|
||||
/*Respect padding and minimum width/height too*/
|
||||
lv_area_copy(&bar->indic_area, &obj->coords);
|
||||
lv_area_copy(&bar->indic_area, &bar_coords);
|
||||
bar->indic_area.x1 += bg_left;
|
||||
bar->indic_area.x2 -= bg_right;
|
||||
bar->indic_area.y1 += bg_top;
|
||||
@@ -420,7 +424,7 @@ static void draw_indic(lv_event_t * e)
|
||||
|
||||
/*Get the max possible indicator area. The gradient should be applied on this*/
|
||||
lv_area_t mask_indic_max_area;
|
||||
lv_area_copy(&mask_indic_max_area, &obj->coords);
|
||||
lv_area_copy(&mask_indic_max_area, &bar_coords);
|
||||
mask_indic_max_area.x1 += bg_left;
|
||||
mask_indic_max_area.y1 += bg_top;
|
||||
mask_indic_max_area.x2 -= bg_right;
|
||||
|
||||
Reference in New Issue
Block a user