diff options
author | Dave Davenport <qball@gmpclient.org> | 2015-10-05 18:22:01 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2015-10-05 18:22:01 +0200 |
commit | 01aa2e32cc354b2703e0237e749dc9eb2016b635 (patch) | |
tree | 382a40e79a300de1bf56adb939facecc6c0a5e7d /source/textbox.c | |
parent | 77cdc8d7c4aab103d4ac1252cfe1653e14c914a4 (diff) |
When element is to high, don't y center.
Diffstat (limited to 'source/textbox.c')
-rw-r--r-- | source/textbox.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/textbox.c b/source/textbox.c index ff2c3edc..6c1e73f3 100644 --- a/source/textbox.c +++ b/source/textbox.c @@ -272,7 +272,12 @@ static void texbox_update ( textbox *tb ) int tw = textbox_get_font_width ( tb ); x = ( ( tb->w - tw - 2 * SIDE_MARGIN ) ) / 2; } - y = ( ( tb->h - textbox_get_font_height ( tb ) ) ) / 2; + short fh = textbox_get_font_height ( tb ); + if(fh > tb->h) { + y=0; + }else { + y = ( ( tb->h - fh ) ) / 2; + } // Set ARGB Color col = tb->color_bg; |