From acc16d69abd896d55f058f9e70aeb3dc76b481b1 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 29 Dec 2008 00:59:22 +0000 Subject: [PATCH] "fix" pixels getting cut off for some people svn path=/trunk/KDE/kdelibs/; revision=902719 --- paintutils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paintutils.cpp b/paintutils.cpp index 1e6457d23..c9444af05 100644 --- a/paintutils.cpp +++ b/paintutils.cpp @@ -68,7 +68,13 @@ QPixmap shadowText(QString text, const QFont &font, QColor textColor, QColor sha QPainter p(&textPixmap); p.setPen(textColor); p.setFont(font); - p.drawText(textPixmap.rect(), Qt::AlignLeft, text); + // FIXME: the center alignment here is odd: the rect should be the size needed by + // the text, but for some fonts and configurations this is off by a pixel or so + // and "centering" the text painting 'fixes' that. Need to research why + // this is the case and determine if we should be painting it differently here, + // doing soething different with the boundingRect call or if it's a problem + // in Qt itself + p.drawText(textPixmap.rect(), Qt::AlignCenter, text); p.end(); //Draw blurred shadow