From 79ce3ef424754d65081957121dcbe6efbc1885d2 Mon Sep 17 00:00:00 2001 From: Pete Beardmore Date: Sun, 4 Mar 2018 21:44:35 +0000 Subject: fbtk, textbox, fix text vertical centering --- src/FbTk/TextBox.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc index 2cfec30..2e3ed7f 100644 --- a/src/FbTk/TextBox.cc +++ b/src/FbTk/TextBox.cc @@ -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())); -- cgit v0.11.2