From: Andreas Monzner Date: Thu, 24 Nov 2005 19:24:47 +0000 (+0000) Subject: fix RT_VALIGN_CENTER X-Git-Tag: 2.6.0~4965 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/9f0676bf1c67c28f7ffb114bcff785d455d7b509 fix RT_VALIGN_CENTER --- diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp index 55d266c0..7f884024 100644 --- a/lib/gdi/grc.cpp +++ b/lib/gdi/grc.cpp @@ -442,7 +442,9 @@ void gDC::exec(gOpcode *o) if (o->parm.renderText->flags & gPainter::RT_VALIGN_CENTER) { eRect bbox = para->getBoundBox(); - offset += ePoint(0, (o->parm.renderText->area.height() - bbox.height()) / 2); + int vcentered_top = (o->parm.renderText->area.height() - bbox.height()) / 2; + int correction = vcentered_top - bbox.top(); + offset += ePoint(0, correction); } para->blit(*this, offset, getRGB(m_background_color), getRGB(m_foreground_color)); delete o->parm.renderText;