make it easy for when source == dest, which is a common case

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=863721
This commit is contained in:
Aaron J. Seigo 2008-09-22 23:15:57 +00:00
parent cd7e48a164
commit d3bff41f31
2 changed files with 3 additions and 2 deletions

View File

@ -379,7 +379,7 @@ void PanelSvg::paintPanel(QPainter* painter, const QRectF& target, const QRectF&
Q_ASSERT(panel->cachedBackground);
}
painter->drawPixmap(target, *(panel->cachedBackground), source);
painter->drawPixmap(target, *(panel->cachedBackground), source.isValid() ? source : target);
}
void PanelSvg::paintPanel(QPainter* painter, const QPointF& pos)

View File

@ -229,7 +229,8 @@ class PLASMA_EXPORT PanelSvg : public Svg
* @arg target the target rectangle on the paint device
* @arg source the portion rectangle of the source image
*/
Q_INVOKABLE void paintPanel(QPainter* painter, const QRectF& target, const QRectF& source);
Q_INVOKABLE void paintPanel(QPainter* painter, const QRectF& target,
const QRectF& source = QRectF());
/**
* Paints the loaded SVG with the elements that represents the border