summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorChristopher Ham <christopher.ham@nokia.com>2010-12-02 03:12:18 (GMT)
committerChristopher Ham <christopher.ham@nokia.com>2010-12-02 03:17:04 (GMT)
commit03ff62841c5dae85fde40982a65980a91c5f3109 (patch)
tree2147549b11ce17592567495a1aefa84008a20b9f /src/declarative
parent49187bc691e67dca741d300e95d5fcde146d5118 (diff)
downloadQt-03ff62841c5dae85fde40982a65980a91c5f3109.zip
Qt-03ff62841c5dae85fde40982a65980a91c5f3109.tar.gz
Qt-03ff62841c5dae85fde40982a65980a91c5f3109.tar.bz2
Rectangle should not paint with negative width or height
Task-number: QTBUG-15250 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index dedb3f7..59d1a84 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -470,6 +470,8 @@ void QDeclarativeRectangle::generateBorderedRect()
void QDeclarativeRectangle::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
{
Q_D(QDeclarativeRectangle);
+ if (width() <= 0 || height() <= 0)
+ return;
if (d->radius > 0 || (d->pen && d->pen->isValid())
|| (d->gradient && d->gradient->gradient()) ) {
drawRect(*p);