From 582cf8b6b9d1d43d9e7432bfe2298cd625feb475 Mon Sep 17 00:00:00 2001 From: VIFEX Date: Tue, 3 Sep 2024 13:04:13 +0800 Subject: [PATCH] fix(vg_lite/vector): convert gradient matrix to global matrix (#6577) Signed-off-by: pengxiaolei Signed-off-by: pengyiqiang Co-authored-by: pengxiaolei --- src/draw/vg_lite/lv_draw_vg_lite_vector.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 5aa443afa..481be5cdb 100644 --- a/src/draw/vg_lite/lv_draw_vg_lite_vector.c +++ b/src/draw/vg_lite/lv_draw_vg_lite_vector.c @@ -251,7 +251,15 @@ static void task_draw_cb(void * ctx, const lv_vector_path_t * path, const lv_vec break; case LV_VECTOR_DRAW_STYLE_GRADIENT: { vg_lite_matrix_t grad_matrix; - lv_vg_lite_matrix(&grad_matrix, &dsc->fill_dsc.matrix); + vg_lite_identity(&grad_matrix); + +#if !LV_USE_VG_LITE_THORVG + /* Workaround inconsistent matrix behavior between device and ThorVG */ + lv_vg_lite_matrix_multiply(&grad_matrix, &matrix); +#endif + vg_lite_matrix_t fill_matrix; + lv_vg_lite_matrix(&fill_matrix, &dsc->fill_dsc.matrix); + lv_vg_lite_matrix_multiply(&grad_matrix, &fill_matrix); lv_vg_lite_draw_grad( u,