X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/73fb21862b1daf86d4dd08d514b31c58122e7c9f..22143de3c8c4780166beeb1e0a1575768c76bfe4:/lib/gdi/grc.cpp diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp index 55d266c0..f54f1604 100644 --- a/lib/gdi/grc.cpp +++ b/lib/gdi/grc.cpp @@ -1,5 +1,5 @@ // for debugging use: -// #define SYNC_PAINT + #define SYNC_PAINT #include #ifndef SYNC_PAINT #include @@ -227,6 +227,8 @@ void gPainter::blit(gPixmap *pixmap, ePoint pos, const eRect &clip, int flags) { gOpcode o; + ASSERT(pixmap); + o.opcode=gOpcode::blit; o.dc = m_dc.grabRef(); pixmap->AddRef(); @@ -442,7 +444,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;