diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-15 06:36:30 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-15 06:36:30 (GMT) |
commit | 40ae4a41ab449f1d95dbbf2c91ade05cac8348a4 (patch) | |
tree | c242c96648fd6ae6abd034de807ef0fba255ef17 /src | |
parent | 3e056e3c1da450d3b879b68cdfa15bc5959ffbc8 (diff) | |
download | Qt-40ae4a41ab449f1d95dbbf2c91ade05cac8348a4.zip Qt-40ae4a41ab449f1d95dbbf2c91ade05cac8348a4.tar.gz Qt-40ae4a41ab449f1d95dbbf2c91ade05cac8348a4.tar.bz2 |
Clip text drawing to bounding rect
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/fx/qfxtext.cpp | 9 |
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) |