- painter.renderText(eRect(0, 0, size().width(), size().height()), m_text, gPainter::RT_HALIGN_CENTER|gPainter::RT_VALIGN_CENTER);
+
+ if (m_have_foreground_color)
+ painter.setForegroundColor(m_foreground_color);
+
+ int flags = 0;
+ if (m_valign == alignTop)
+ flags |= gPainter::RT_VALIGN_TOP;
+ else if (m_valign == alignCenter)
+ flags |= gPainter::RT_VALIGN_CENTER;
+ else if (m_valign == alignBottom)
+ flags |= gPainter::RT_VALIGN_BOTTOM;
+
+ if (m_halign == alignLeft)
+ flags |= gPainter::RT_HALIGN_LEFT;
+ else if (m_halign == alignCenter)
+ flags |= gPainter::RT_HALIGN_CENTER;
+ else if (m_halign == alignRight)
+ flags |= gPainter::RT_HALIGN_RIGHT;
+ else if (m_halign == alignBlock)
+ flags |= gPainter::RT_HALIGN_BLOCK;
+
+ flags |= gPainter::RT_WRAP;
+ painter.renderText(eRect(0, 0, size().width(), size().height()), m_text, flags);