1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(vg_lite): fix LV_RADIUS_CIRCLE not round (#5543)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech 2024-01-31 21:00:21 +08:00 committed by GitHub
parent 2bb393c375
commit 8b189f4496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -61,14 +61,14 @@ void lv_draw_vg_lite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc
int32_t w = lv_area_get_width(coords);
int32_t h = lv_area_get_height(coords);
int32_t r_out = dsc->radius;
if(r_out) {
int32_t r_short = LV_MIN(w, h) / 2;
float r_out = dsc->radius;
if(dsc->radius) {
float r_short = LV_MIN(w, h) / 2.0f;
r_out = LV_MIN(r_out, r_short);
}
int32_t border_w = dsc->width;
int32_t r_in = LV_MAX(0, r_out - border_w);
float r_in = LV_MAX(0, r_out - border_w);
lv_vg_lite_path_t * path = lv_vg_lite_path_get(u, VG_LITE_S16);
lv_vg_lite_path_set_quality(path, dsc->radius == 0 ? VG_LITE_LOW : VG_LITE_HIGH);

View File

@ -65,9 +65,9 @@ void lv_draw_vg_lite_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t *
int32_t w = lv_area_get_width(coords);
int32_t h = lv_area_get_height(coords);
int32_t r = dsc->radius;
if(r) {
int32_t r_short = LV_MIN(w, h) / 2;
float r = dsc->radius;
if(dsc->radius) {
float r_short = LV_MIN(w, h) / 2.0f;
r = LV_MIN(r, r_short);
}