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:
parent
e16ba8fed0
commit
5a2ae9f976
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user