summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxrect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx/qfxrect.cpp')
-rw-r--r--src/declarative/fx/qfxrect.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index 371aa0c..dafd8a2 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -486,8 +486,8 @@ void QFxRect::drawRect(QPainter &p)
}
//basically same code as QFxImage uses to paint sci images
- int xSide = offset * 2;
- int ySide = offset * 2;
+ int xSide = qMin(offset * 2, int(width()));
+ int ySide = qMin(offset * 2, int(height()));;
// Upper left
p.drawImage(QRect(0, 0, offset, offset), d->_rectImage, QRect(0, 0, offset, offset));