fix(vg_lite): fix outline label is not displayed under transform (#5345)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2024-01-16 17:38:31 +08:00
committed by GitHub
parent ab15bc8092
commit 5c459ba544

View File

@@ -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);