fix(style): auto formatted
This commit is contained in:
@@ -471,7 +471,7 @@ typedef void * lv_user_data_t;
|
|||||||
# define LV_THEME_DEFAULT_PALETTE_LIGHT 1
|
# define LV_THEME_DEFAULT_PALETTE_LIGHT 1
|
||||||
|
|
||||||
/*1: Enable grow on press*/
|
/*1: Enable grow on press*/
|
||||||
# define LV_THEME_DEFAULT_GROW 1
|
# define LV_THEME_DEFAULT_GROW 1
|
||||||
|
|
||||||
/*Default transition time in [ms]*/
|
/*Default transition time in [ms]*/
|
||||||
# define LV_THEME_DEFAULT_TRANSITON_TIME 80
|
# define LV_THEME_DEFAULT_TRANSITON_TIME 80
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
|
|||||||
obj->flags |= f;
|
obj->flags |= f;
|
||||||
|
|
||||||
if(f & LV_OBJ_FLAG_HIDDEN) {
|
if(f & LV_OBJ_FLAG_HIDDEN) {
|
||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
|
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
|
||||||
@@ -367,10 +367,10 @@ void lv_obj_clear_flag(lv_obj_t * obj, lv_obj_flag_t f)
|
|||||||
obj->flags &= (~f);
|
obj->flags &= (~f);
|
||||||
|
|
||||||
if(f & LV_OBJ_FLAG_HIDDEN) {
|
if(f & LV_OBJ_FLAG_HIDDEN) {
|
||||||
lv_obj_invalidate(obj);
|
lv_obj_invalidate(obj);
|
||||||
if(lv_obj_is_layout_positioned(obj)) {
|
if(lv_obj_is_layout_positioned(obj)) {
|
||||||
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
|
lv_obj_mark_layout_as_dirty(lv_obj_get_parent(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
|
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
|
||||||
|
|||||||
@@ -749,32 +749,32 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
|
|||||||
obj_scr != lv_disp_get_layer_top(disp) &&
|
obj_scr != lv_disp_get_layer_top(disp) &&
|
||||||
obj_scr != lv_disp_get_layer_sys(disp))
|
obj_scr != lv_disp_get_layer_sys(disp))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Truncate the area to the object*/
|
/*Truncate the area to the object*/
|
||||||
lv_area_t obj_coords;
|
lv_area_t obj_coords;
|
||||||
lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj);
|
lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj);
|
||||||
lv_area_copy(&obj_coords, &obj->coords);
|
lv_area_copy(&obj_coords, &obj->coords);
|
||||||
obj_coords.x1 -= ext_size;
|
obj_coords.x1 -= ext_size;
|
||||||
obj_coords.y1 -= ext_size;
|
obj_coords.y1 -= ext_size;
|
||||||
obj_coords.x2 += ext_size;
|
obj_coords.x2 += ext_size;
|
||||||
obj_coords.y2 += ext_size;
|
obj_coords.y2 += ext_size;
|
||||||
|
|
||||||
bool is_common;
|
bool is_common;
|
||||||
|
|
||||||
is_common = _lv_area_intersect(area, area, &obj_coords);
|
is_common = _lv_area_intersect(area, area, &obj_coords);
|
||||||
if(is_common == false) return false; /*The area is not on the object*/
|
if(is_common == false) return false; /*The area is not on the object*/
|
||||||
|
|
||||||
/*Truncate recursively to the parents*/
|
/*Truncate recursively to the parents*/
|
||||||
lv_obj_t * par = lv_obj_get_parent(obj);
|
lv_obj_t * par = lv_obj_get_parent(obj);
|
||||||
while(par != NULL) {
|
while(par != NULL) {
|
||||||
is_common = _lv_area_intersect(area, area, &par->coords);
|
is_common = _lv_area_intersect(area, area, &par->coords);
|
||||||
if(is_common == false) return false; /*If no common parts with parent break;*/
|
if(is_common == false) return false; /*If no common parts with parent break;*/
|
||||||
if(lv_obj_has_flag(par, LV_OBJ_FLAG_HIDDEN)) return false; /*If the parent is hidden then the child is hidden and won't be drawn*/
|
if(lv_obj_has_flag(par, LV_OBJ_FLAG_HIDDEN)) return false; /*If the parent is hidden then the child is hidden and won't be drawn*/
|
||||||
|
|
||||||
par = lv_obj_get_parent(par);
|
par = lv_obj_get_parent(par);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,29 +370,29 @@ static void obj_del_core(lv_obj_t * obj)
|
|||||||
|
|
||||||
/*Remove the screen for the screen list*/
|
/*Remove the screen for the screen list*/
|
||||||
if(obj->parent == NULL) {
|
if(obj->parent == NULL) {
|
||||||
lv_disp_t * disp = lv_obj_get_disp(obj);
|
lv_disp_t * disp = lv_obj_get_disp(obj);
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
/*Find the screen in the list*/
|
/*Find the screen in the list*/
|
||||||
for(i = 0; i < disp->screen_cnt; i++) {
|
for(i = 0; i < disp->screen_cnt; i++) {
|
||||||
if(disp->screens[i] == obj) break;
|
if(disp->screens[i] == obj) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t id = i;
|
uint32_t id = i;
|
||||||
for(i = id; i < disp->screen_cnt - 1; i++) {
|
for(i = id; i < disp->screen_cnt - 1; i++) {
|
||||||
disp->screens[i] = disp->screens[i + 1];
|
disp->screens[i] = disp->screens[i + 1];
|
||||||
}
|
}
|
||||||
disp->screen_cnt--;
|
disp->screen_cnt--;
|
||||||
disp->screens = lv_mem_realloc(disp->screens, disp->screen_cnt * sizeof(lv_obj_t *));
|
disp->screens = lv_mem_realloc(disp->screens, disp->screen_cnt * sizeof(lv_obj_t *));
|
||||||
}
|
}
|
||||||
/*Remove the object from the child list of its parent*/
|
/*Remove the object from the child list of its parent*/
|
||||||
else {
|
else {
|
||||||
uint32_t id = lv_obj_get_child_id(obj);
|
uint32_t id = lv_obj_get_child_id(obj);
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for(i = id; i < obj->parent->spec_attr->child_cnt - 1; i++) {
|
for(i = id; i < obj->parent->spec_attr->child_cnt - 1; i++) {
|
||||||
obj->parent->spec_attr->children[i] = obj->parent->spec_attr->children[i + 1];
|
obj->parent->spec_attr->children[i] = obj->parent->spec_attr->children[i + 1];
|
||||||
}
|
}
|
||||||
obj->parent->spec_attr->child_cnt--;
|
obj->parent->spec_attr->child_cnt--;
|
||||||
obj->parent->spec_attr->children = lv_mem_realloc(obj->parent->spec_attr->children, obj->parent->spec_attr->child_cnt * sizeof(lv_obj_t *));
|
obj->parent->spec_attr->children = lv_mem_realloc(obj->parent->spec_attr->children, obj->parent->spec_attr->child_cnt * sizeof(lv_obj_t *));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Free the object itself*/
|
/*Free the object itself*/
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ static int32_t find_track_end(lv_obj_t * cont, flex_t * f, int32_t item_start_id
|
|||||||
if(t->track_main_size > 0) t->track_main_size -= item_gap; /*There is no gap after the last item*/
|
if(t->track_main_size > 0) t->track_main_size -= item_gap; /*There is no gap after the last item*/
|
||||||
|
|
||||||
if(grow_item_cnt && grow_sum) {
|
if(grow_item_cnt && grow_sum) {
|
||||||
lv_coord_t s = max_main_size - t->track_main_size; /*The remaining size for grow items*/
|
lv_coord_t s = max_main_size - t->track_main_size; /*The remaining size for grow items*/
|
||||||
t->grow_unit = s / grow_sum;
|
t->grow_unit = s / grow_sum;
|
||||||
t->track_main_size = max_main_size; /*If there is at least one "grow item" the track takes the full space*/
|
t->track_main_size = max_main_size; /*If there is at least one "grow item" the track takes the full space*/
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -906,17 +906,17 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area)
|
|||||||
|
|
||||||
lv_obj_draw_dsc_t dsc;
|
lv_obj_draw_dsc_t dsc;
|
||||||
lv_obj_draw_dsc_init(&dsc, &series_mask);
|
lv_obj_draw_dsc_init(&dsc, &series_mask);
|
||||||
dsc.part = LV_PART_ITEMS;
|
dsc.part = LV_PART_ITEMS;
|
||||||
|
|
||||||
/*Go through all points*/
|
/*Go through all points*/
|
||||||
for(i = 0; i < chart->point_cnt; i++) {
|
for(i = 0; i < chart->point_cnt; i++) {
|
||||||
lv_coord_t x_act = (int32_t)((int32_t)(w + block_gap) * i) / (chart->point_cnt) + obj->coords.x1 + x_ofs;
|
lv_coord_t x_act = (int32_t)((int32_t)(w + block_gap) * i) / (chart->point_cnt) + obj->coords.x1 + x_ofs;
|
||||||
|
|
||||||
dsc.id = i;
|
dsc.id = i;
|
||||||
|
|
||||||
/*Draw the current point of all data line*/
|
/*Draw the current point of all data line*/
|
||||||
_LV_LL_READ_BACK(&chart->series_ll, ser) {
|
_LV_LL_READ_BACK(&chart->series_ll, ser) {
|
||||||
if (ser->hidden) continue;
|
if (ser->hidden) continue;
|
||||||
lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->last_point : 0;
|
lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->last_point : 0;
|
||||||
|
|
||||||
col_a.x1 = x_act;
|
col_a.x1 = x_act;
|
||||||
@@ -934,13 +934,13 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area)
|
|||||||
col_a.y1 = h - y_tmp + obj->coords.y1 + y_ofs;
|
col_a.y1 = h - y_tmp + obj->coords.y1 + y_ofs;
|
||||||
|
|
||||||
if(ser->points[p_act] != LV_CHART_POINT_NONE) {
|
if(ser->points[p_act] != LV_CHART_POINT_NONE) {
|
||||||
dsc.draw_area = &col_a;
|
dsc.draw_area = &col_a;
|
||||||
dsc.rect_dsc = &col_dsc;
|
dsc.rect_dsc = &col_dsc;
|
||||||
dsc.sub_part_ptr = ser;
|
dsc.sub_part_ptr = ser;
|
||||||
dsc.value = ser->points[p_act];
|
dsc.value = ser->points[p_act];
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||||
lv_draw_rect(&col_a, &series_mask, &col_dsc);
|
lv_draw_rect(&col_a, &series_mask, &col_dsc);
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* @file lv_label.c
|
* @file lv_label.c
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -361,21 +361,21 @@ static void draw_knob(lv_obj_t * obj)
|
|||||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||||
dsc.part = LV_PART_KNOB;
|
dsc.part = LV_PART_KNOB;
|
||||||
dsc.id = 0;
|
dsc.id = 0;
|
||||||
dsc.draw_area = &slider->right_knob_area;
|
dsc.draw_area = &slider->right_knob_area;
|
||||||
dsc.rect_dsc = &knob_rect_dsc;
|
dsc.rect_dsc = &knob_rect_dsc;
|
||||||
|
|
||||||
if(lv_slider_get_mode(obj) != LV_SLIDER_MODE_RANGE) {
|
if(lv_slider_get_mode(obj) != LV_SLIDER_MODE_RANGE) {
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||||
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
|
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||||
} else {
|
} else {
|
||||||
/*Save the draw dsc. because it can be modified in the event*/
|
/*Save the draw dsc. because it can be modified in the event*/
|
||||||
lv_draw_rect_dsc_t knob_rect_dsc_tmp;
|
lv_draw_rect_dsc_t knob_rect_dsc_tmp;
|
||||||
lv_memcpy(&knob_rect_dsc_tmp, &knob_rect_dsc, sizeof(lv_draw_rect_dsc_t));
|
lv_memcpy(&knob_rect_dsc_tmp, &knob_rect_dsc, sizeof(lv_draw_rect_dsc_t));
|
||||||
|
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||||
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
|
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||||
|
|
||||||
/*Draw a second knob for the start_value side*/
|
/*Draw a second knob for the start_value side*/
|
||||||
if(hor) {
|
if(hor) {
|
||||||
@@ -387,14 +387,14 @@ static void draw_knob(lv_obj_t * obj)
|
|||||||
position_knob(obj, &knob_area, knob_size, hor);
|
position_knob(obj, &knob_area, knob_size, hor);
|
||||||
lv_area_copy(&slider->left_knob_area, &knob_area);
|
lv_area_copy(&slider->left_knob_area, &knob_area);
|
||||||
|
|
||||||
lv_memcpy(&knob_rect_dsc, &knob_rect_dsc_tmp, sizeof(lv_draw_rect_dsc_t));
|
lv_memcpy(&knob_rect_dsc, &knob_rect_dsc_tmp, sizeof(lv_draw_rect_dsc_t));
|
||||||
dsc.draw_area = &slider->left_knob_area;
|
dsc.draw_area = &slider->left_knob_area;
|
||||||
dsc.rect_dsc = &knob_rect_dsc;
|
dsc.rect_dsc = &knob_rect_dsc;
|
||||||
dsc.id = 1;
|
dsc.id = 1;
|
||||||
|
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||||
lv_draw_rect(&slider->left_knob_area, clip_area, &knob_rect_dsc);
|
lv_draw_rect(&slider->left_knob_area, clip_area, &knob_rect_dsc);
|
||||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user