aboutsummaryrefslogtreecommitdiffstats
path: root/src/gdisp
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-07-30 14:19:05 +1000
committerinmarket <andrewh@inmarket.com.au>2013-07-30 14:19:05 +1000
commit0ee1b2045128d1a3e40a7caec4ff2dc718caf741 (patch)
tree8f439dfafa21cb2651e6c253d6afaa266923bfe0 /src/gdisp
parentab04b1d0762fb22a28aa340da273a9165c12953b (diff)
downloaduGFX-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/gdisp')
-rw-r--r--src/gdisp/gdisp.c1
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);
}