Add font baseline to the starting point of string rendering.

Otherwise the limit calculation will cut off the first character
on larger fonts, like DejaVuSans24.
ugfx_release_2.6
inmarket 2013-07-30 14:19:05 +10:00
parent ab04b1d076
commit 0ee1b20451
1 changed files with 1 additions and 0 deletions

View File

@ -671,6 +671,7 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
state.cx = GDISP.Width - x;
state.cy = GDISP.Height - y;
x += font->baseline_x;
mf_render_aligned(font, x, y, MF_ALIGN_LEFT, str, 0, gdispDrawString_callback, &state);
}