diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-30 14:19:05 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-30 14:19:05 +1000 |
commit | 0ee1b2045128d1a3e40a7caec4ff2dc718caf741 (patch) | |
tree | 8f439dfafa21cb2651e6c253d6afaa266923bfe0 /src | |
parent | ab04b1d0762fb22a28aa340da273a9165c12953b (diff) | |
download | uGFX-0ee1b2045128d1a3e40a7caec4ff2dc718caf741.tar.gz uGFX-0ee1b2045128d1a3e40a7caec4ff2dc718caf741.tar.bz2 uGFX-0ee1b2045128d1a3e40a7caec4ff2dc718caf741.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/gdisp/gdisp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gdisp/gdisp.c b/src/gdisp/gdisp.c index 5ad06f96..22773908 100644 --- a/src/gdisp/gdisp.c +++ b/src/gdisp/gdisp.c @@ -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); } |