Don't try to create a nice shadow on a text if the text is empty (avoid some warnings)

Rev by aseigo

svn path=/trunk/KDE/kdelibs/; revision=889759
This commit is contained in:
Alexis Ménard 2008-11-27 14:52:08 +00:00
parent e16ba8fed0
commit 5a2ae9f976

View File

@ -49,6 +49,10 @@ void shadowBlur(QImage &image, int radius, const QColor &color)
QPixmap shadowText(QString text, QColor textColor, QColor shadowColor, QPoint offset, int radius)
{
//don't try to paint stuff on a future null pixmap because the text is empty
if (text.size() == 0) {
return QPixmap();
}
// Draw text
QFontMetrics fm(text);
QRect textRect = fm.boundingRect(text);