contentsRect must be bigger

we draw the text at 1,1
This commit is contained in:
Marco Martin 2011-02-09 18:16:48 +01:00
parent 11d3b789a4
commit 9eca40ca38

View File

@ -107,7 +107,8 @@ QPixmap shadowText(QString text, const QFont &font, QColor textColor, QColor sha
QPixmap texturedText(const QString &text, const QFont &font, Plasma::Svg *texture) QPixmap texturedText(const QString &text, const QFont &font, Plasma::Svg *texture)
{ {
QFontMetrics fm(font); QFontMetrics fm(font);
QRect contentsRect = fm.boundingRect(text); //the text will be moved a bit from contentsRect
QRect contentsRect = fm.boundingRect(text).adjusted(0, 0, 2, 2);
contentsRect.moveTo(0,0); contentsRect.moveTo(0,0);
QPixmap pixmap(contentsRect.size()); QPixmap pixmap(contentsRect.size());