fix RT_VALIGN_CENTER
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 24 Nov 2005 19:24:47 +0000 (19:24 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 24 Nov 2005 19:24:47 +0000 (19:24 +0000)
lib/gdi/grc.cpp

index 55d266c..7f88402 100644 (file)
@@ -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;