summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfximage.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-09-15 06:23:57 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-09-15 06:23:57 (GMT)
commitb43b430b0668d145e31fd0445ed9d272270a576c (patch)
tree0cc28e21844da6d8717c9e47a51428a89e12d4b3 /src/declarative/fx/qfximage.cpp
parent8cad28ef7abf92cab034ae3586e24cd0b8be38a2 (diff)
parent7c6bc5a25d11a9d455b5bf96cb5229f78790db3a (diff)
downloadQt-b43b430b0668d145e31fd0445ed9d272270a576c.zip
Qt-b43b430b0668d145e31fd0445ed9d272270a576c.tar.gz
Qt-b43b430b0668d145e31fd0445ed9d272270a576c.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfximage.cpp')
-rw-r--r--src/declarative/fx/qfximage.cpp41
1 files changed, 6 insertions, 35 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 99e1b72..3ac3f3c 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -252,41 +252,12 @@ void QFxImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
if (width() != d->pix.width() || height() != d->pix.height()) {
if (d->fillMode >= Tile) {
- p->save();
- p->setClipRect(0, 0, width(), height(), Qt::IntersectClip);
-
- if (d->fillMode == Tile) {
- const int pw = d->pix.width();
- const int ph = d->pix.height();
- int yy = 0;
-
- while(yy < height()) {
- int xx = 0;
- while(xx < width()) {
- p->drawPixmap(xx, yy, d->pix);
- xx += pw;
- }
- yy += ph;
- }
- } else if (d->fillMode == TileVertically) {
- const int ph = d->pix.height();
- int yy = 0;
-
- while(yy < height()) {
- p->drawPixmap(QRect(0, yy, width(), ph), d->pix);
- yy += ph;
- }
- } else {
- const int pw = d->pix.width();
- int xx = 0;
-
- while(xx < width()) {
- p->drawPixmap(QRect(xx, 0, pw, height()), d->pix);
- xx += pw;
- }
- }
-
- p->restore();
+ if (d->fillMode == Tile)
+ p->drawTiledPixmap(QRectF(0,0,width(),height()), d->pix);
+ else if (d->fillMode == TileVertically)
+ p->drawTiledPixmap(QRectF(0,0,d->pix.width(),height()), d->pix);
+ else
+ p->drawTiledPixmap(QRectF(0,0,width(),d->pix.height()), d->pix);
} else {
qreal widthScale = width() / qreal(d->pix.width());
qreal heightScale = height() / qreal(d->pix.height());