From 9d4c26dd73128eb707a3a348ff6d8a421d7f265e Mon Sep 17 00:00:00 2001 From: VIFEX Date: Sat, 12 Oct 2024 10:04:38 +0800 Subject: [PATCH] fix(vg_lite): fix path bonding box coordinate overflow (#7037) Signed-off-by: FASTSHIFT --- src/draw/vg_lite/lv_draw_vg_lite_vector.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/draw/vg_lite/lv_draw_vg_lite_vector.c b/src/draw/vg_lite/lv_draw_vg_lite_vector.c index f1a0e3f47..fe4ae63c5 100644 --- a/src/draw/vg_lite/lv_draw_vg_lite_vector.c +++ b/src/draw/vg_lite/lv_draw_vg_lite_vector.c @@ -25,6 +25,10 @@ * DEFINES *********************/ +/* Since thorvg has an upper limit on coordinates, choose a suitable value here */ +#define PATH_COORD_MAX (1 << 18) +#define PATH_COORD_MIN (-PATH_COORD_MAX) + /********************** * TYPEDEFS **********************/ @@ -181,8 +185,8 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec /* no bonding box */ lv_vg_lite_path_set_bonding_box(lv_vg_path, - (float)LV_COORD_MIN, (float)LV_COORD_MIN, - (float)LV_COORD_MAX, (float)LV_COORD_MAX); + (float)PATH_COORD_MIN, (float)PATH_COORD_MIN, + (float)PATH_COORD_MAX, (float)PATH_COORD_MAX); } else { /* calc inverse matrix */