mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
refactor(draw_hook): rename lv_obj_draw_hook_dsc_t to lv_obj_draw_dsc_t
Based on #2142
This commit is contained in:
parent
7f32ffe203
commit
85f21a1345
@ -5,7 +5,7 @@
|
||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_hook_dsc_t * dsc = lv_event_get_param();
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
|
||||
/*Change the draw descriptor the 2nd button */
|
||||
if(dsc->id == 1) {
|
||||
@ -32,7 +32,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
}
|
||||
}
|
||||
if(e == LV_EVENT_DRAW_PART_END) {
|
||||
lv_obj_draw_hook_dsc_t * dsc = lv_event_get_param();
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
|
||||
/*Add custom content to the 4th button when the button itself was drawn*/
|
||||
if(dsc->id == 3) {
|
||||
|
@ -9,13 +9,13 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
/*Add the faded area before the lines are drawn */
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_hook_dsc_t * hook_dsc = lv_event_get_param();
|
||||
if(hook_dsc->part != LV_PART_ITEMS) return;
|
||||
if(!hook_dsc->p1 || !hook_dsc->p2) return;
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
if(dsc->part != LV_PART_ITEMS) return;
|
||||
if(!dsc->p1 || !dsc->p2) return;
|
||||
|
||||
/*Add a line mask that keeps the area below the line*/
|
||||
lv_draw_mask_line_param_t line_mask_param;
|
||||
lv_draw_mask_line_points_init(&line_mask_param, hook_dsc->p1->x, hook_dsc->p1->y, hook_dsc->p2->x, hook_dsc->p2->y, LV_DRAW_MASK_LINE_SIDE_BOTTOM);
|
||||
lv_draw_mask_line_points_init(&line_mask_param, dsc->p1->x, dsc->p1->y, dsc->p2->x, dsc->p2->y, LV_DRAW_MASK_LINE_SIDE_BOTTOM);
|
||||
int16_t line_mask_id = lv_draw_mask_add(&line_mask_param, NULL);
|
||||
|
||||
/*Add a fade effect: transparent bottom covering top*/
|
||||
@ -28,14 +28,14 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
lv_draw_rect_dsc_t draw_rect_dsc;
|
||||
lv_draw_rect_dsc_init(&draw_rect_dsc);
|
||||
draw_rect_dsc.bg_opa = LV_OPA_20;
|
||||
draw_rect_dsc.bg_color = hook_dsc->line_dsc->color;
|
||||
draw_rect_dsc.bg_color = dsc->line_dsc->color;
|
||||
|
||||
lv_area_t a;
|
||||
a.x1 = hook_dsc->p1->x;
|
||||
a.x2 = hook_dsc->p2->x - 1;
|
||||
a.y1 = LV_MIN(hook_dsc->p1->y, hook_dsc->p2->y);
|
||||
a.x1 = dsc->p1->x;
|
||||
a.x2 = dsc->p2->x - 1;
|
||||
a.y1 = LV_MIN(dsc->p1->y, dsc->p2->y);
|
||||
a.y2 = obj->coords.y2;
|
||||
lv_draw_rect(&a, hook_dsc->clip_area, &draw_rect_dsc);
|
||||
lv_draw_rect(&a, dsc->clip_area, &draw_rect_dsc);
|
||||
|
||||
/*Remove the masks*/
|
||||
lv_draw_mask_remove_id(line_mask_id);
|
||||
|
@ -5,10 +5,10 @@ static void event_cb(lv_obj_t * chart, lv_event_t e)
|
||||
{
|
||||
LV_UNUSED(chart);
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_hook_dsc_t * hook_dsc = lv_event_get_param();
|
||||
if(hook_dsc->part == LV_PART_TICKS && hook_dsc->id == LV_CHART_AXIS_X) {
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
if(dsc->part == LV_PART_TICKS && dsc->id == LV_CHART_AXIS_X) {
|
||||
const char * month[] = {"Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"};
|
||||
lv_snprintf(hook_dsc->text, sizeof(hook_dsc->text), "%s", month[hook_dsc->value]);
|
||||
lv_snprintf(dsc->text, sizeof(dsc->text), "%s", month[dsc->value]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
}
|
||||
}
|
||||
else if(e == LV_EVENT_DRAW_PART_END) {
|
||||
lv_obj_draw_hook_dsc_t * hook_dsc = lv_event_get_param();
|
||||
if(hook_dsc->part == LV_PART_CURSOR && hook_dsc->p1 && hook_dsc->p2 && hook_dsc->p1->y == hook_dsc->p2->y && last_id >= 0) {
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
if(dsc->part == LV_PART_CURSOR && dsc->p1 && dsc->p2 && dsc->p1->y == dsc->p2->y && last_id >= 0) {
|
||||
lv_coord_t * data_array = lv_chart_get_array(chart, ser);
|
||||
lv_coord_t v = data_array[last_id];
|
||||
char buf[16];
|
||||
@ -28,9 +28,9 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
lv_txt_get_size(&size, buf, LV_FONT_DEFAULT, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
|
||||
lv_area_t a;
|
||||
a.y2 = hook_dsc->p1->y - 5;
|
||||
a.y2 = dsc->p1->y - 5;
|
||||
a.y1 = a.y2 - size.y - 10;
|
||||
a.x1 = hook_dsc->p1->x + 10;
|
||||
a.x1 = dsc->p1->x + 10;
|
||||
a.x2 = a.x1 + size.x + 10;
|
||||
|
||||
lv_draw_rect_dsc_t draw_rect_dsc;
|
||||
@ -38,7 +38,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
draw_rect_dsc.bg_color = lv_color_blue();
|
||||
draw_rect_dsc.radius = 3;
|
||||
|
||||
lv_draw_rect(&a, hook_dsc->clip_area, &draw_rect_dsc);
|
||||
lv_draw_rect(&a, dsc->clip_area, &draw_rect_dsc);
|
||||
|
||||
lv_draw_label_dsc_t draw_label_dsc;
|
||||
lv_draw_label_dsc_init(&draw_label_dsc);
|
||||
@ -47,7 +47,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
a.x2 -= 5;
|
||||
a.y1 += 5;
|
||||
a.y2 -= 5;
|
||||
lv_draw_label(&a, hook_dsc->clip_area, &draw_label_dsc, buf, NULL);
|
||||
lv_draw_label(&a, dsc->clip_area, &draw_label_dsc, buf, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,27 +4,27 @@
|
||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_hook_dsc_t * hook_dsc = lv_event_get_param();
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
/*If the cells are drawn...*/
|
||||
if(hook_dsc->part == LV_PART_ITEMS) {
|
||||
uint32_t row = hook_dsc->id / lv_table_get_col_cnt(obj);
|
||||
uint32_t col = hook_dsc->id - row * lv_table_get_col_cnt(obj);
|
||||
if(dsc->part == LV_PART_ITEMS) {
|
||||
uint32_t row = dsc->id / lv_table_get_col_cnt(obj);
|
||||
uint32_t col = dsc->id - row * lv_table_get_col_cnt(obj);
|
||||
|
||||
/*Make the texts in the first cell center aligned*/
|
||||
if(row == 0) {
|
||||
hook_dsc->label_dsc->align = LV_TEXT_ALIGN_CENTER;
|
||||
hook_dsc->rect_dsc->bg_color = lv_color_mix(lv_color_blue(), hook_dsc->rect_dsc->bg_color, LV_OPA_20);
|
||||
hook_dsc->rect_dsc->bg_opa = LV_OPA_COVER;
|
||||
dsc->label_dsc->align = LV_TEXT_ALIGN_CENTER;
|
||||
dsc->rect_dsc->bg_color = lv_color_mix(lv_color_blue(), dsc->rect_dsc->bg_color, LV_OPA_20);
|
||||
dsc->rect_dsc->bg_opa = LV_OPA_COVER;
|
||||
}
|
||||
/*In the first column align the texts to the right*/
|
||||
else if(col == 0) {
|
||||
hook_dsc->label_dsc->flag = LV_TEXT_ALIGN_RIGHT;
|
||||
dsc->label_dsc->flag = LV_TEXT_ALIGN_RIGHT;
|
||||
}
|
||||
|
||||
/*MAke every 2nd row grayish*/
|
||||
if((row != 0 && row % 2) == 0) {
|
||||
hook_dsc->rect_dsc->bg_color = lv_color_mix(lv_color_grey(), hook_dsc->rect_dsc->bg_color, LV_OPA_10);
|
||||
hook_dsc->rect_dsc->bg_opa = LV_OPA_COVER;
|
||||
dsc->rect_dsc->bg_color = lv_color_mix(lv_color_grey(), dsc->rect_dsc->bg_color, LV_OPA_10);
|
||||
dsc->rect_dsc->bg_opa = LV_OPA_COVER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,10 @@
|
||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
if(e == LV_EVENT_DRAW_PART_END) {
|
||||
lv_obj_draw_hook_dsc_t * hook_dsc = lv_event_get_param();
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
/*If the cells are drawn...*/
|
||||
if(hook_dsc->part == LV_PART_ITEMS) {
|
||||
bool chk = lv_table_has_cell_ctrl(obj, hook_dsc->id, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
|
||||
if(dsc->part == LV_PART_ITEMS) {
|
||||
bool chk = lv_table_has_cell_ctrl(obj, dsc->id, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
|
||||
|
||||
lv_draw_rect_dsc_t rect_dsc;
|
||||
lv_draw_rect_dsc_init(&rect_dsc);
|
||||
@ -17,11 +17,11 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
rect_dsc.radius = LV_RADIUS_CIRCLE;
|
||||
|
||||
lv_area_t sw_area;
|
||||
sw_area.x1 = hook_dsc->draw_area->x2 - 50;
|
||||
sw_area.x1 = dsc->draw_area->x2 - 50;
|
||||
sw_area.x2 = sw_area.x1 + 40;
|
||||
sw_area.y1 = hook_dsc->draw_area->y1 + lv_area_get_height(hook_dsc->draw_area) / 2 - 10;
|
||||
sw_area.y1 = dsc->draw_area->y1 + lv_area_get_height(dsc->draw_area) / 2 - 10;
|
||||
sw_area.y2 = sw_area.y1 + 20;
|
||||
lv_draw_rect(&sw_area, hook_dsc->clip_area, &rect_dsc);
|
||||
lv_draw_rect(&sw_area, dsc->clip_area, &rect_dsc);
|
||||
|
||||
rect_dsc.bg_color = lv_color_white();
|
||||
if(chk) {
|
||||
@ -33,7 +33,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
}
|
||||
sw_area.y1 += 2;
|
||||
sw_area.y2 -= 2;
|
||||
lv_draw_rect(&sw_area, hook_dsc->clip_area, &rect_dsc);
|
||||
lv_draw_rect(&sw_area, dsc->clip_area, &rect_dsc);
|
||||
}
|
||||
}
|
||||
else if(e == LV_EVENT_VALUE_CHANGED) {
|
||||
|
@ -375,10 +375,10 @@ lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint8_t part)
|
||||
return s;
|
||||
}
|
||||
|
||||
void lv_obj_draw_hook_dsc_init(lv_obj_draw_hook_dsc_t * hook_dsc, const lv_area_t * clip_area)
|
||||
void lv_obj_draw_dsc_init(lv_obj_draw_dsc_t * dsc, const lv_area_t * clip_area)
|
||||
{
|
||||
lv_memset_00(hook_dsc, sizeof(lv_obj_draw_hook_dsc_t));
|
||||
hook_dsc->clip_area = clip_area;
|
||||
lv_memset_00(dsc, sizeof(lv_obj_draw_dsc_t));
|
||||
dsc->clip_area = clip_area;
|
||||
}
|
||||
|
||||
void lv_obj_refresh_ext_draw_size(lv_obj_t * obj)
|
||||
|
@ -51,7 +51,7 @@ typedef struct
|
||||
uint32_t id;
|
||||
uint32_t part :8;
|
||||
const void * sub_part_ptr;
|
||||
}lv_obj_draw_hook_dsc_t;
|
||||
}lv_obj_draw_dsc_t;
|
||||
|
||||
/** Design modes */
|
||||
enum {
|
||||
@ -130,11 +130,11 @@ void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint8_t part, lv_draw_arc_
|
||||
lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint8_t part);
|
||||
|
||||
/**
|
||||
* Initialize a draw hook.
|
||||
* @param hook_dsc pointer to a raw hook. Later it should be passed as parameter to an `LV_EEVNT_DRAW_PART_BEGIN/END` event.
|
||||
* Initialize a draw descriptor used in events.
|
||||
* @param dsc pointer to a descriptor. Later it should be passed as parameter to an `LV_EEVNT_DRAW_PART_BEGIN/END` event.
|
||||
* @param clip_area the current clip area of the drawing
|
||||
*/
|
||||
void lv_obj_draw_hook_dsc_init(lv_obj_draw_hook_dsc_t * hook_dsc, const lv_area_t * clip_area);
|
||||
void lv_obj_draw_dsc_init(lv_obj_draw_dsc_t * dsc, const lv_area_t * clip_area);
|
||||
|
||||
/**
|
||||
* Send a 'LV_SIGNAL_REFR_EXT_DRAW_SIZE' signal to the object to refresh the value of the extended draw size.
|
||||
|
@ -255,31 +255,31 @@ static void my_constructor(lv_obj_t * obj, const lv_obj_t * copy)
|
||||
static void draw_event_cb(lv_obj_t * obj, lv_event_t e)
|
||||
{
|
||||
if(e == LV_EVENT_DRAW_PART_BEGIN) {
|
||||
lv_obj_draw_hook_dsc_t * hook_dsc = lv_event_get_param();
|
||||
if(hook_dsc->part == LV_PART_ITEMS) {
|
||||
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
|
||||
if(dsc->part == LV_PART_ITEMS) {
|
||||
/*Day name styles*/
|
||||
if(hook_dsc->id < 7) {
|
||||
hook_dsc->rect_dsc->bg_opa = LV_OPA_TRANSP;
|
||||
hook_dsc->rect_dsc->border_opa = LV_OPA_TRANSP;
|
||||
if(dsc->id < 7) {
|
||||
dsc->rect_dsc->bg_opa = LV_OPA_TRANSP;
|
||||
dsc->rect_dsc->border_opa = LV_OPA_TRANSP;
|
||||
}
|
||||
else if(lv_btnmatrix_has_btn_ctrl(obj, hook_dsc->id, LV_BTNMATRIX_CTRL_DISABLED)) {
|
||||
hook_dsc->rect_dsc->bg_opa = LV_OPA_TRANSP;
|
||||
hook_dsc->rect_dsc->border_opa = LV_OPA_TRANSP;
|
||||
hook_dsc->label_dsc->color = lv_color_grey();
|
||||
else if(lv_btnmatrix_has_btn_ctrl(obj, dsc->id, LV_BTNMATRIX_CTRL_DISABLED)) {
|
||||
dsc->rect_dsc->bg_opa = LV_OPA_TRANSP;
|
||||
dsc->rect_dsc->border_opa = LV_OPA_TRANSP;
|
||||
dsc->label_dsc->color = lv_color_grey();
|
||||
}
|
||||
|
||||
if(lv_btnmatrix_has_btn_ctrl(obj, hook_dsc->id, LV_CALENDAR_CTRL_HIGHLIGHT)) {
|
||||
hook_dsc->rect_dsc->bg_opa = LV_OPA_40;
|
||||
hook_dsc->rect_dsc->bg_color = lv_theme_get_color_primary(obj);
|
||||
if(lv_btnmatrix_get_selected_btn(obj) == hook_dsc->id) {
|
||||
hook_dsc->rect_dsc->bg_opa = LV_OPA_70;
|
||||
if(lv_btnmatrix_has_btn_ctrl(obj, dsc->id, LV_CALENDAR_CTRL_HIGHLIGHT)) {
|
||||
dsc->rect_dsc->bg_opa = LV_OPA_40;
|
||||
dsc->rect_dsc->bg_color = lv_theme_get_color_primary(obj);
|
||||
if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) {
|
||||
dsc->rect_dsc->bg_opa = LV_OPA_70;
|
||||
}
|
||||
}
|
||||
|
||||
if(lv_btnmatrix_has_btn_ctrl(obj, hook_dsc->id, LV_CALENDAR_CTRL_TODAY)) {
|
||||
hook_dsc->rect_dsc->border_opa = LV_OPA_COVER;
|
||||
hook_dsc->rect_dsc->border_color = lv_theme_get_color_primary(obj);
|
||||
hook_dsc->rect_dsc->border_width += 1;
|
||||
if(lv_btnmatrix_has_btn_ctrl(obj, dsc->id, LV_CALENDAR_CTRL_TODAY)) {
|
||||
dsc->rect_dsc->border_opa = LV_OPA_COVER;
|
||||
dsc->rect_dsc->border_color = lv_theme_get_color_primary(obj);
|
||||
dsc->rect_dsc->border_width += 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -441,11 +441,11 @@ static lv_draw_res_t lv_btnmatrix_draw(lv_obj_t * obj, const lv_area_t * clip_ar
|
||||
char * txt_ap = lv_mem_buf_get(txt_ap_size);
|
||||
#endif
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.part = LV_PART_ITEMS;
|
||||
hook_dsc.rect_dsc = &draw_rect_dsc_act;
|
||||
hook_dsc.label_dsc = &draw_label_dsc_act;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
dsc.rect_dsc = &draw_rect_dsc_act;
|
||||
dsc.label_dsc = &draw_label_dsc_act;
|
||||
|
||||
for(btn_i = 0; btn_i < btnm->btn_cnt; btn_i++, txt_i++) {
|
||||
/*Search the next valid text in the map*/
|
||||
@ -492,9 +492,9 @@ static lv_draw_res_t lv_btnmatrix_draw(lv_obj_t * obj, const lv_area_t * clip_ar
|
||||
obj->style_list.skip_trans = 0;
|
||||
}
|
||||
|
||||
hook_dsc.draw_area = &btn_area;
|
||||
hook_dsc.id = btn_i;
|
||||
lv_event_send(obj,LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
dsc.draw_area = &btn_area;
|
||||
dsc.id = btn_i;
|
||||
lv_event_send(obj,LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
|
||||
/*Remove borders on the edges if `LV_BORDER_SIDE_INTERNAL`*/
|
||||
if(draw_rect_dsc_act.border_side & LV_BORDER_SIDE_INTERNAL) {
|
||||
@ -536,7 +536,7 @@ static lv_draw_res_t lv_btnmatrix_draw(lv_obj_t * obj, const lv_area_t * clip_ar
|
||||
lv_draw_label(&btn_area, clip_area, &draw_label_dsc_act, txt, NULL);
|
||||
|
||||
|
||||
lv_event_send(obj,LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj,LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
|
||||
obj->style_list.skip_trans = 0;
|
||||
|
@ -792,12 +792,12 @@ static void draw_series_line(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
y_tmp = y_tmp / (chart->ymax[ser->y_axis] - chart->ymin[ser->y_axis]);
|
||||
p2.y = h - y_tmp + y_ofs;
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.part = LV_PART_ITEMS;
|
||||
hook_dsc.line_dsc = &line_dsc_default;
|
||||
hook_dsc.rect_dsc = &point_dsc_default;
|
||||
hook_dsc.sub_part_ptr = ser;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
dsc.line_dsc = &line_dsc_default;
|
||||
dsc.rect_dsc = &point_dsc_default;
|
||||
dsc.sub_part_ptr = ser;
|
||||
|
||||
lv_coord_t y_min = p2.y;
|
||||
lv_coord_t y_max = p2.y;
|
||||
@ -849,13 +849,13 @@ static void draw_series_line(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
point_area.y1 = p1.y - point_size_act;
|
||||
point_area.y2 = p1.y + point_size_act;
|
||||
|
||||
hook_dsc.id = i - 1;
|
||||
hook_dsc.p1 = ser->points[p_prev] != LV_CHART_POINT_NONE ? &p1 : NULL;
|
||||
hook_dsc.p2 = ser->points[p_act] != LV_CHART_POINT_NONE ? &p2 : NULL;
|
||||
hook_dsc.draw_area = &point_area;
|
||||
hook_dsc.value = ser->points[p_prev];
|
||||
dsc.id = i - 1;
|
||||
dsc.p1 = ser->points[p_prev] != LV_CHART_POINT_NONE ? &p1 : NULL;
|
||||
dsc.p2 = ser->points[p_act] != LV_CHART_POINT_NONE ? &p2 : NULL;
|
||||
dsc.draw_area = &point_area;
|
||||
dsc.value = ser->points[p_prev];
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
|
||||
if(ser->points[p_prev] != LV_CHART_POINT_NONE && ser->points[p_act] != LV_CHART_POINT_NONE) {
|
||||
lv_draw_line(&p1, &p2, &series_mask, &line_dsc_default);
|
||||
@ -865,7 +865,7 @@ static void draw_series_line(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
lv_draw_rect(&point_area, &series_mask, &point_dsc_default);
|
||||
}
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
|
||||
}
|
||||
@ -883,14 +883,14 @@ static void draw_series_line(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
point_area.y1 = p2.y - point_size_act;
|
||||
point_area.y2 = p2.y + point_size_act;
|
||||
|
||||
hook_dsc.id = i - 1;
|
||||
hook_dsc.p1 = NULL;
|
||||
hook_dsc.p2 = NULL;
|
||||
hook_dsc.draw_area = &point_area;
|
||||
hook_dsc.value = ser->points[p_act];
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
dsc.id = i - 1;
|
||||
dsc.p1 = NULL;
|
||||
dsc.p2 = NULL;
|
||||
dsc.draw_area = &point_area;
|
||||
dsc.value = ser->points[p_act];
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_rect(&point_area, &series_mask, &point_dsc_default);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -932,16 +932,16 @@ static void draw_series_bar(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
bool mask_ret = _lv_area_intersect(&series_mask, &obj->coords, clip_area);
|
||||
if(mask_ret == false) return;
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, &series_mask);
|
||||
hook_dsc.part = LV_PART_ITEMS;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, &series_mask);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
|
||||
|
||||
/*Go through all points*/
|
||||
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;
|
||||
|
||||
hook_dsc.id = i;
|
||||
dsc.id = i;
|
||||
|
||||
/*Draw the current point of all data line*/
|
||||
_LV_LL_READ_BACK(&chart->series_ll, ser) {
|
||||
@ -963,13 +963,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;
|
||||
|
||||
if(ser->points[p_act] != LV_CHART_POINT_NONE) {
|
||||
hook_dsc.draw_area = &col_a;
|
||||
hook_dsc.rect_dsc = &col_dsc;
|
||||
hook_dsc.sub_part_ptr = ser;
|
||||
hook_dsc.value = ser->points[p_act];
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
dsc.draw_area = &col_a;
|
||||
dsc.rect_dsc = &col_dsc;
|
||||
dsc.sub_part_ptr = ser;
|
||||
dsc.value = ser->points[p_act];
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_rect(&col_a, &series_mask, &col_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1003,11 +1003,11 @@ static void draw_cursors(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
/*Do not bother with line ending is the point will over it*/
|
||||
if(point_radius > line_dsc_ori.width / 2) line_dsc_ori.raw_end = 1;
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.line_dsc = &line_dsc_tmp;
|
||||
hook_dsc.rect_dsc = &point_dsc_tmp;
|
||||
hook_dsc.part = LV_PART_CURSOR;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.line_dsc = &line_dsc_tmp;
|
||||
dsc.rect_dsc = &point_dsc_tmp;
|
||||
dsc.part = LV_PART_CURSOR;
|
||||
|
||||
/*Go through all cursor lines*/
|
||||
_LV_LL_READ_BACK(&chart->cursor_ll, cursor) {
|
||||
@ -1018,8 +1018,8 @@ static void draw_cursors(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
line_dsc_tmp.color = cursor->color;
|
||||
point_dsc_tmp.bg_color = cursor->color;
|
||||
|
||||
hook_dsc.p1 = &p1;
|
||||
hook_dsc.p2 = &p2;
|
||||
dsc.p1 = &p1;
|
||||
dsc.p2 = &p2;
|
||||
|
||||
lv_coord_t cx = obj->coords.x1 + cursor->point.x;
|
||||
lv_coord_t cy = obj->coords.y1 + cursor->point.y;
|
||||
@ -1030,9 +1030,9 @@ static void draw_cursors(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
p2.x = cursor->dir & LV_DIR_RIGHT ? obj->coords.x2 : cx;
|
||||
p2.y = p1.y;
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_line(&p1, &p2, clip_area, &line_dsc_tmp);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
|
||||
if(cursor->dir & LV_DIR_VER) {
|
||||
@ -1040,9 +1040,9 @@ static void draw_cursors(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
p1.y = cursor->dir & LV_DIR_TOP ? obj->coords.y1 : cy;
|
||||
p2.x = p1.x;
|
||||
p2.y = cursor->dir & LV_DIR_BOTTOM ? obj->coords.y2 : cy;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_line(&p1, &p2, clip_area, &line_dsc_tmp);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
|
||||
if(point_radius) {
|
||||
@ -1053,13 +1053,13 @@ static void draw_cursors(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
point_area.y1 = cy - point_radius;
|
||||
point_area.y2 = cy + point_radius;
|
||||
|
||||
hook_dsc.draw_area = &point_area;
|
||||
hook_dsc.p1 = NULL;
|
||||
hook_dsc.p2 = NULL;
|
||||
dsc.draw_area = &point_area;
|
||||
dsc.p1 = NULL;
|
||||
dsc.p2 = NULL;
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_rect(&point_area, clip_area, &point_dsc_tmp);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1100,10 +1100,10 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a
|
||||
minor_len *= -1;
|
||||
}
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.id = axis;
|
||||
hook_dsc.part = LV_PART_TICKS;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.id = axis;
|
||||
dsc.part = LV_PART_TICKS;
|
||||
|
||||
lv_draw_line_dsc_t line_dsc;
|
||||
lv_draw_line_dsc_init(&line_dsc);
|
||||
@ -1141,13 +1141,13 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a
|
||||
/* add text only to major tick */
|
||||
if(major && t->label_en) {
|
||||
int32_t tick_value = chart->ymax[axis] - lv_map(i, 0, total_tick_num, chart->ymin[axis], chart->ymax[axis]);
|
||||
lv_snprintf(hook_dsc.text, sizeof(hook_dsc.text), "%d", tick_value);
|
||||
hook_dsc.value = tick_value;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_snprintf(dsc.text, sizeof(dsc.text), "%d", tick_value);
|
||||
dsc.value = tick_value;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
|
||||
/* reserve appropriate area */
|
||||
lv_point_t size;
|
||||
lv_txt_get_size(&size, hook_dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
lv_txt_get_size(&size, dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
|
||||
/* set the area at some distance of the major tick len left of the tick */
|
||||
lv_area_t a;
|
||||
@ -1166,7 +1166,7 @@ static void draw_y_ticks(lv_obj_t * obj, const lv_area_t * clip_area, lv_chart_a
|
||||
if(a.y2 >= obj->coords.y1 &&
|
||||
a.y1 <= obj->coords.y2)
|
||||
{
|
||||
lv_draw_label(&a, clip_area, &label_dsc, hook_dsc.text, NULL);
|
||||
lv_draw_label(&a, clip_area, &label_dsc, dsc.text, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1206,10 +1206,10 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
line_dsc.dash_gap = 0;
|
||||
line_dsc.dash_width = 0;
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.id = LV_CHART_AXIS_X;
|
||||
hook_dsc.part = LV_PART_TICKS;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.id = LV_CHART_AXIS_X;
|
||||
dsc.part = LV_PART_TICKS;
|
||||
|
||||
/* The columns ticks should be aligned to the center of blocks */
|
||||
if(chart->type == LV_CHART_TYPE_BAR) {
|
||||
@ -1240,13 +1240,13 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
if(!major || !t->label_en) continue;
|
||||
|
||||
int32_t tick_value = i / t->minor_cnt;
|
||||
lv_snprintf(hook_dsc.text, sizeof(hook_dsc.text), "%d", i / t->minor_cnt);
|
||||
hook_dsc.value = tick_value;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_snprintf(dsc.text, sizeof(dsc.text), "%d", i / t->minor_cnt);
|
||||
dsc.value = tick_value;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
|
||||
/* reserve appropriate area */
|
||||
lv_point_t size;
|
||||
lv_txt_get_size(&size, hook_dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
lv_txt_get_size(&size, dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
|
||||
/* set the area at some distance of the major tick len under of the tick */
|
||||
lv_area_t a;
|
||||
@ -1258,7 +1258,7 @@ static void draw_x_ticks(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
if(a.x2 >= obj->coords.x1 &&
|
||||
a.x1 <= obj->coords.x2)
|
||||
{
|
||||
lv_draw_label(&a, clip_area, &label_dsc, hook_dsc.text, NULL);
|
||||
lv_draw_label(&a, clip_area, &label_dsc, dsc.text, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -385,8 +385,8 @@ static void draw_ticks_and_labels(lv_obj_t * obj, const lv_area_t * clip_area, c
|
||||
|
||||
lv_meter_scale_t * scale;
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
lv_draw_mask_radius_param_t inner_minor_mask;
|
||||
@ -525,13 +525,13 @@ static void draw_ticks_and_labels(lv_obj_t * obj, const lv_area_t * clip_area, c
|
||||
lv_draw_label_dsc_t label_dsc_tmp;
|
||||
lv_memcpy(&label_dsc_tmp, &label_dsc, sizeof(label_dsc_tmp));
|
||||
|
||||
hook_dsc.id = value_of_line;
|
||||
hook_dsc.label_dsc = &label_dsc_tmp;
|
||||
lv_snprintf(hook_dsc.text, sizeof(hook_dsc.text), "%d", value_of_line);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
dsc.id = value_of_line;
|
||||
dsc.label_dsc = &label_dsc_tmp;
|
||||
lv_snprintf(dsc.text, sizeof(dsc.text), "%d", value_of_line);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
|
||||
lv_point_t label_size;
|
||||
lv_txt_get_size(&label_size, hook_dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
|
||||
lv_txt_get_size(&label_size, dsc.text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
|
||||
LV_COORD_MAX, LV_TEXT_FLAG_NONE);
|
||||
|
||||
lv_area_t label_cord;
|
||||
@ -540,7 +540,7 @@ static void draw_ticks_and_labels(lv_obj_t * obj, const lv_area_t * clip_area, c
|
||||
label_cord.x2 = label_cord.x1 + label_size.x;
|
||||
label_cord.y2 = label_cord.y1 + label_size.y;
|
||||
|
||||
lv_draw_label(&label_cord, clip_area, &label_dsc, hook_dsc.text, NULL);
|
||||
lv_draw_label(&label_cord, clip_area, &label_dsc, dsc.text, NULL);
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
outer_mask_id = lv_draw_mask_add(&outer_mask, NULL);
|
||||
|
@ -393,25 +393,25 @@ static void draw_knob(lv_obj_t * obj, const lv_area_t * clip_area)
|
||||
position_knob(obj, &knob_area, knob_size, hor);
|
||||
lv_area_copy(&slider->right_knob_area, &knob_area);
|
||||
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.part = LV_PART_KNOB;
|
||||
hook_dsc.id = 0;
|
||||
hook_dsc.draw_area = &slider->right_knob_area;
|
||||
hook_dsc.rect_dsc = &knob_rect_dsc;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_KNOB;
|
||||
dsc.id = 0;
|
||||
dsc.draw_area = &slider->right_knob_area;
|
||||
dsc.rect_dsc = &knob_rect_dsc;
|
||||
|
||||
if(lv_slider_get_type(obj) != LV_SLIDER_TYPE_RANGE) {
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
} else {
|
||||
/*Save the draw dsc. because it can be modified in the hook*/
|
||||
/*Save the draw dsc. because it can be modified in the event*/
|
||||
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_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_rect(&slider->right_knob_area, clip_area, &knob_rect_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
|
||||
/* Draw a second knob for the start_value side */
|
||||
if(hor) {
|
||||
@ -424,13 +424,13 @@ static void draw_knob(lv_obj_t * obj, const lv_area_t * clip_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));
|
||||
hook_dsc.draw_area = &slider->left_knob_area;
|
||||
hook_dsc.rect_dsc = &knob_rect_dsc;
|
||||
hook_dsc.id = 1;
|
||||
dsc.draw_area = &slider->left_knob_area;
|
||||
dsc.rect_dsc = &knob_rect_dsc;
|
||||
dsc.id = 1;
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
lv_draw_rect(&slider->left_knob_area, clip_area, &knob_rect_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -479,12 +479,12 @@ static lv_draw_res_t lv_table_draw(lv_obj_t * obj, const lv_area_t * clip_area,
|
||||
obj->state = LV_STATE_DEFAULT;
|
||||
obj->style_list.skip_trans = 1;
|
||||
lv_draw_rect_dsc_t rect_dsc_def;
|
||||
lv_draw_rect_dsc_t rect_dsc_act; /*Passed to the draw_hook to modify it*/
|
||||
lv_draw_rect_dsc_t rect_dsc_act; /*Passed to the event to modify it*/
|
||||
lv_draw_rect_dsc_init(&rect_dsc_def);
|
||||
lv_obj_init_draw_rect_dsc(obj, LV_PART_ITEMS, &rect_dsc_def);
|
||||
|
||||
lv_draw_label_dsc_t label_dsc_def;
|
||||
lv_draw_label_dsc_t label_dsc_act; /*Passed to the draw_hook to modify it*/
|
||||
lv_draw_label_dsc_t label_dsc_act; /*Passed to the event to modify it*/
|
||||
lv_draw_label_dsc_init(&label_dsc_def);
|
||||
lv_obj_init_draw_label_dsc(obj, LV_PART_ITEMS, &label_dsc_def);
|
||||
obj->state = state_ori;
|
||||
@ -499,11 +499,11 @@ static lv_draw_res_t lv_table_draw(lv_obj_t * obj, const lv_area_t * clip_area,
|
||||
bool rtl = lv_obj_get_base_dir(obj) == LV_BIDI_DIR_RTL ? true : false;
|
||||
|
||||
/*Handle custom drawer*/
|
||||
lv_obj_draw_hook_dsc_t hook_dsc;
|
||||
lv_obj_draw_hook_dsc_init(&hook_dsc, clip_area);
|
||||
hook_dsc.part = LV_PART_ITEMS;
|
||||
hook_dsc.rect_dsc = &rect_dsc_act;
|
||||
hook_dsc.label_dsc = &label_dsc_act;
|
||||
lv_obj_draw_dsc_t dsc;
|
||||
lv_obj_draw_dsc_init(&dsc, clip_area);
|
||||
dsc.part = LV_PART_ITEMS;
|
||||
dsc.rect_dsc = &rect_dsc_act;
|
||||
dsc.label_dsc = &label_dsc_act;
|
||||
|
||||
for(row = 0; row < table->row_cnt; row++) {
|
||||
lv_coord_t h_row = table->row_h[row];
|
||||
@ -594,9 +594,9 @@ static lv_draw_res_t lv_table_draw(lv_obj_t * obj, const lv_area_t * clip_area,
|
||||
obj->style_list.skip_trans = 0;
|
||||
}
|
||||
|
||||
hook_dsc.draw_area = &cell_area_border;
|
||||
hook_dsc.id = row * table->col_cnt + col;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &hook_dsc);
|
||||
dsc.draw_area = &cell_area_border;
|
||||
dsc.id = row * table->col_cnt + col;
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_BEGIN, &dsc);
|
||||
|
||||
lv_draw_rect(&cell_area_border, clip_area, &rect_dsc_act);
|
||||
|
||||
@ -629,7 +629,7 @@ static lv_draw_res_t lv_table_draw(lv_obj_t * obj, const lv_area_t * clip_area,
|
||||
}
|
||||
}
|
||||
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &hook_dsc);
|
||||
lv_event_send(obj, LV_EVENT_DRAW_PART_END, &dsc);
|
||||
|
||||
cell += col_merge + 1;
|
||||
col += col_merge;
|
||||
|
Loading…
x
Reference in New Issue
Block a user