summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-05-15 06:36:30 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-05-15 06:36:30 (GMT)
commit40ae4a41ab449f1d95dbbf2c91ade05cac8348a4 (patch)
treec242c96648fd6ae6abd034de807ef0fba255ef17 /src/declarative
parent3e056e3c1da450d3b879b68cdfa15bc5959ffbc8 (diff)
downloadQt-40ae4a41ab449f1d95dbbf2c91ade05cac8348a4.zip
Qt-40ae4a41ab449f1d95dbbf2c91ade05cac8348a4.tar.gz
Qt-40ae4a41ab449f1d95dbbf2c91ade05cac8348a4.tar.bz2
Clip text drawing to bounding rect
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxtext.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index a43219d..bc3856d 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -749,7 +749,16 @@ void QFxText::paintContents(QPainter &p)
break;
}
+ bool needClip = !clip() && (d->imgCache.width() > width() ||
+ d->imgCache.height() > height());
+
+ if (needClip) {
+ p.save();
+ p.setClipRect(boundingRect());
+ }
p.drawImage(x, y, d->imgCache);
+ if (needClip)
+ p.restore();
}
#elif defined(QFX_RENDER_OPENGL2)