summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfximage.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-14 05:41:45 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-14 05:41:45 (GMT)
commitb7f710a79b3d5f529dde8ad43ee4e0b78100674f (patch)
treeb06f6b6d827d524834bff5ac8a1147c3c918e7c8 /src/declarative/fx/qfximage.cpp
parentefc9a552d6d3f03b962ce0df260fb2c61b8b8ec1 (diff)
downloadQt-b7f710a79b3d5f529dde8ad43ee4e0b78100674f.zip
Qt-b7f710a79b3d5f529dde8ad43ee4e0b78100674f.tar.gz
Qt-b7f710a79b3d5f529dde8ad43ee4e0b78100674f.tar.bz2
Have scale grid images degrade a bit nicer.
If a scale grid image has offsets that add up to bigger than the size, we don't paint the middle bits at all.
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r--src/declarative/fx/qfximage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index dfd6915..9d7a36a 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -365,8 +365,8 @@ void QFxImage::paintContents(QPainter &p)
const int sgr = d->_scaleGrid->right();
const int sgt = d->_scaleGrid->top();
const int sgb = d->_scaleGrid->bottom();
- const int xSide = sgl + sgr;
- const int ySide = sgt + sgb;
+ const int xSide = qMin(sgl + sgr, int(width()));
+ const int ySide = qMin(sgt + sgb, int(height()));
// Upper left
if (sgt && sgl)