fix RT_VALIGN_CENTER in painter.setText
[enigma2.git] / lib / gdi / grc.cpp
index 1f5cdfb138f48086612a3f352f8b7fb8baf42627..e00bd540d57df2b64671ee3554ffb89078380cfe 100644 (file)
@@ -1,4 +1,5 @@
 // for debugging use:
 // for debugging use:
+// #define SYNC_PAINT
 #include <unistd.h>
 #ifndef SYNC_PAINT
 #include <pthread.h>
 #include <unistd.h>
 #ifndef SYNC_PAINT
 #include <pthread.h>
@@ -496,7 +497,7 @@ void gDC::exec(gOpcode *o)
                if (o->parm.renderText->flags & gPainter::RT_VALIGN_CENTER)
                {
                        eRect bbox = para->getBoundBox();
                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);
                }
                        int correction = vcentered_top - bbox.top();
                        offset += ePoint(0, correction);
                }