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:
parent
2bb393c375
commit
8b189f4496
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user