|
|
@@ -755,22 +755,19 @@ extern void font_stb_get_scale_from_font_size(font_t* f, font_size_t font_size,
|
|
|
|
|
|
static ret_t canvas_draw_glyph_vglite(canvas_t* c, void* sf, glyph_t* g, wchar_t chr, xy_t x, xy_t y, float_t scale) {
|
|
|
|
|
|
- rect_t r;
|
|
|
rect_t dst;
|
|
|
- xy_t x2 = x + g->w - 1;
|
|
|
- xy_t y2 = y + g->h - 1;
|
|
|
+ rect_t r;
|
|
|
|
|
|
- if (!canvas_is_rect_in_clip_rect(c, x + g->x, y + g->y, x2, y2)) {
|
|
|
+ if (!canvas_is_rect_in_clip_rect(c, x, y - g->h, x + g->w, y)) {
|
|
|
return RET_OK;
|
|
|
}
|
|
|
canvas_get_clip_rect(c, &r);
|
|
|
|
|
|
dst.x = x;
|
|
|
dst.y = y;
|
|
|
- dst.w = x2 - dst.x + 1;
|
|
|
- dst.h = y2 - dst.y + 1;
|
|
|
-
|
|
|
- return lcd_draw_glyph_vglite(c->lcd, sf, chr, &dst, &r, scale);
|
|
|
+ dst.w = g->w;
|
|
|
+ dst.h = g->h;
|
|
|
+ return lcd_draw_glyph_vglite(c->lcd, sf, chr, &dst, &r, scale, g->x, g->y);
|
|
|
}
|
|
|
|
|
|
static ret_t canvas_draw_text_vglite_impl(canvas_t* c, const wchar_t* str, uint32_t nr, xy_t x, xy_t y, bool_t line_breaker) {
|
|
|
@@ -804,8 +801,8 @@ static ret_t canvas_draw_text_vglite_impl(canvas_t* c, const wchar_t* str, uint3
|
|
|
}
|
|
|
|
|
|
if (font_get_glyph(c->font, chr, c->font_size, &g) == RET_OK) {
|
|
|
- xy_t xx = x;
|
|
|
- xy_t yy = y + baseline;
|
|
|
+ xy_t xx = x + g.x;
|
|
|
+ xy_t yy = y - g.y + baseline;
|
|
|
font_stb_get_scale_from_font_size(c->font, c->font_size, &scale);
|
|
|
canvas_draw_glyph_vglite(c, (void *)font_stb_get_sf_from_font(c->font), &g, chr,
|
|
|
xx, yy, scale);
|