Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nxp): fix rounded corner image in NXP vglite #6436

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/draw/lv_draw_rect.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
bg_image_dsc->recolor_opa = dsc->bg_image_recolor_opa;
bg_image_dsc->tile = dsc->bg_image_tiled;
bg_image_dsc->header = header;
bg_image_dsc->clip_radius = dsc->radius;
t->type = LV_DRAW_TASK_TYPE_IMAGE;
lv_draw_finalize_task_creation(layer, t);
}
Expand Down
20 changes: 12 additions & 8 deletions src/draw/nxp/vglite/lv_draw_vglite_border.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,36 +142,40 @@ static void _vglite_draw_border(const lv_area_t * coords, const lv_area_t * clip

uint32_t num_rect = 0;
vg_lite_rectangle_t rect[MAX_NUM_RECTANGLES];
int32_t rect_width = coords->x2 - coords->x1;
int32_t rect_height = coords->y2 - coords->y1;
int32_t shortest_side = LV_MIN(rect_width, rect_height);
int32_t final_radius = LV_MIN(radius, shortest_side / 2);

if(border_side & LV_BORDER_SIDE_TOP) {
rect[num_rect].x = coords->x1 - ceil(line_width / 2.0f);
rect[num_rect].y = coords->y1 - ceil(line_width / 2.0f);
rect[num_rect].width = coords->x2 - coords->x1 + line_width;
rect[num_rect].height = line_width;
rect[num_rect].height = final_radius + ceil(line_width / 2.0f);
num_rect++;
}

if(border_side & LV_BORDER_SIDE_LEFT) {
rect[num_rect].x = coords->x1 - ceil(line_width / 2.0f);
rect[num_rect].y = coords->y1 - ceil(line_width / 2.0f);
rect[num_rect].width = line_width;
rect[num_rect].height = coords->y2 - coords->y1 + line_width;
rect[num_rect].width = final_radius + ceil(line_width / 2.0f);
rect[num_rect].height = coords->y2 - coords->y1 + line_width + 1;
num_rect++;
}

if(border_side & LV_BORDER_SIDE_RIGHT) {
rect[num_rect].x = coords->x2 - ceil(line_width / 2.0f);
rect[num_rect].x = coords->x2 - final_radius + 1;
rect[num_rect].y = coords->y1 - ceil(line_width / 2.0f);
rect[num_rect].width = line_width;
rect[num_rect].height = coords->y2 - coords->y1 + line_width;
rect[num_rect].width = final_radius + ceil(line_width / 2.0f);
rect[num_rect].height = coords->y2 - coords->y1 + line_width + 1;
num_rect++;
}

if(border_side & LV_BORDER_SIDE_BOTTOM) {
rect[num_rect].x = coords->x1 - ceil(line_width / 2.0f);
rect[num_rect].y = coords->y2 - ceil(line_width / 2.0f);
rect[num_rect].y = coords->y2 - final_radius + 1;
rect[num_rect].width = coords->x2 - coords->x1 + line_width;
rect[num_rect].height = line_width;
rect[num_rect].height = final_radius + ceil(line_width / 2.0f);
num_rect++;
}

Expand Down
2 changes: 1 addition & 1 deletion src/draw/nxp/vglite/lv_draw_vglite_img.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static void _vglite_draw_pattern(const lv_area_t * clip_area, const lv_area_t *
/* Path to draw */
int32_t path_data[RECT_PATH_DATA_MAX_SIZE];
uint32_t path_data_size;
vglite_create_rect_path_data(path_data, &path_data_size, 0, coords);
vglite_create_rect_path_data(path_data, &path_data_size, dsc->clip_radius, coords);
vg_lite_quality_t path_quality = VG_LITE_MEDIUM;

vg_lite_path_t path;
Expand Down
Loading