fix(vg_lite): fix path bonding box coordinate overflow (#7037)

Signed-off-by: FASTSHIFT <vifextech@foxmail.com>
This commit is contained in:
VIFEX
2024-10-12 10:04:38 +08:00
committed by GitHub
parent 58c2ab59b0
commit 9d4c26dd73
+6 -2
View File
@@ -25,6 +25,10 @@
* DEFINES * 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 * TYPEDEFS
**********************/ **********************/
@@ -181,8 +185,8 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec
/* no bonding box */ /* no bonding box */
lv_vg_lite_path_set_bonding_box(lv_vg_path, lv_vg_lite_path_set_bonding_box(lv_vg_path,
(float)LV_COORD_MIN, (float)LV_COORD_MIN, (float)PATH_COORD_MIN, (float)PATH_COORD_MIN,
(float)LV_COORD_MAX, (float)LV_COORD_MAX); (float)PATH_COORD_MAX, (float)PATH_COORD_MAX);
} }
else { else {
/* calc inverse matrix */ /* calc inverse matrix */