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

fix(draw_vector): check the point lenght of path in lv_vector_path_get_bounding (#5734)

Signed-off-by: duxiaoliang <duxiaoliang@xiaomi.com>
Co-authored-by: duxiaoliang <duxiaoliang@xiaomi.com>
This commit is contained in:
duliang2008 2024-02-26 17:19:09 +08:00 committed by GitHub
parent 45a8af251a
commit 97ef456e41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -325,7 +325,15 @@ void lv_vector_path_close(lv_vector_path_t * path)
void lv_vector_path_get_bounding(const lv_vector_path_t * path, lv_area_t * area)
{
LV_ASSERT_NULL(path);
LV_ASSERT_NULL(area);
uint32_t len = lv_array_size(&path->points);
if(len == 0) {
lv_memzero(area, sizeof(lv_area_t));
return;
}
lv_fpoint_t * p = lv_array_front(&path->points);
float x1 = p[0].x;
float x2 = p[0].x;