fix RT_VALIGN_CENTER in painter.setText
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 23 Dec 2005 13:58:16 +0000 (13:58 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 23 Dec 2005 13:58:16 +0000 (13:58 +0000)
lib/gdi/grc.cpp

index b09171f..e00bd54 100644 (file)
@@ -497,7 +497,7 @@ void gDC::exec(gOpcode *o)
                if (o->parm.renderText->flags & gPainter::RT_VALIGN_CENTER)
                {
                        eRect bbox = para->getBoundBox();
-                       int vcentered_top = (o->parm.renderText->area.height() - bbox.height()) / 2;
+                       int vcentered_top = o->parm.renderText->area.top() + ((o->parm.renderText->area.height() - bbox.height()) / 2);
                        int correction = vcentered_top - bbox.top();
                        offset += ePoint(0, correction);
                }