From 5c459ba5446d4e711dc380cb8ddaad4ae972c44a Mon Sep 17 00:00:00 2001 From: _VIFEXTech Date: Tue, 16 Jan 2024 17:38:31 +0800 Subject: [PATCH] fix(vg_lite): fix outline label is not displayed under transform (#5345) Signed-off-by: pengyiqiang Co-authored-by: pengyiqiang --- src/draw/vg_lite/lv_draw_vg_lite_label.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/draw/vg_lite/lv_draw_vg_lite_label.c b/src/draw/vg_lite/lv_draw_vg_lite_label.c index 5de4a8c59..927749246 100644 --- a/src/draw/vg_lite/lv_draw_vg_lite_label.c +++ b/src/draw/vg_lite/lv_draw_vg_lite_label.c @@ -209,7 +209,6 @@ static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_ float scale = FT_F26DOT6_TO_PATH_SCALE(lv_freetype_outline_get_scale(dsc->g->resolved_font)); vg_lite_matrix_t matrix; vg_lite_identity(&matrix); - lv_vg_lite_matrix_multiply(&matrix, &u->global_matrix); /* convert to vg-lite coordinate */ vg_lite_translate(pos.x - dsc->g->ofs_x, pos.y + dsc->g->box_h + dsc->g->ofs_y, &matrix); @@ -236,6 +235,10 @@ static void draw_letter_outline(lv_draw_vg_lite_unit_t * u, const lv_draw_glyph_ /* Since the font uses Cartesian coordinates, the y coordinates need to be reversed */ lv_vg_lite_path_set_bonding_box(outline, p1_res.x, p2_res.y, p2_res.x, p1_res.y); + /* Move to the position relative to the first address of the buffer */ + lv_layer_t * layer = u->base_unit.target_layer; + vg_lite_translate(-layer->buf_area.x1 / scale, layer->buf_area.y1 / scale, &matrix); + vg_lite_path_t * vg_lite_path = lv_vg_lite_path_get_path(outline); LV_VG_LITE_ASSERT_DEST_BUFFER(&u->target_buffer);