From 01aa2e32cc354b2703e0237e749dc9eb2016b635 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 5 Oct 2015 18:22:01 +0200 Subject: [PATCH] When element is to high, don't y center. --- source/textbox.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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;