fbtk, textbox, fix text vertical centering

This commit is contained in:
Pete Beardmore 2018-03-04 21:44:35 +00:00 committed by Mathias Gumz
parent 0df41cf838
commit 79ce3ef424

View file

@ -211,7 +211,7 @@ void TextBox::clear() {
Display *dpy = FbTk::App::instance()->display();
FbWindow::clear();
// center text by default
int center_pos = (height() + font().ascent())/2;
int center_pos = (height() - font().height())/2 + font().ascent();
if (gc() == 0)
setGC(DefaultGC(dpy, screenNumber()));