diff options
Diffstat (limited to 'src/declarative/fx/qfxtext.cpp')
-rw-r--r-- | src/declarative/fx/qfxtext.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index 9550af9..d1e118d 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -701,6 +701,21 @@ void QFxTextPrivate::checkImgCache() imgDirty = false; } +bool QFxText::smoothTransform() const +{ + Q_D(const QFxText); + return d->smooth; +} + +void QFxText::setSmoothTransform(bool s) +{ + Q_D(QFxText); + if (d->smooth == s) + return; + d->smooth = s; + update(); +} + #if defined(QFX_RENDER_QPAINTER) void QFxText::paintContents(QPainter &p) { @@ -709,6 +724,11 @@ void QFxText::paintContents(QPainter &p) if (d->imgCache.isNull()) return; + bool oldAA = p.testRenderHint(QPainter::Antialiasing); + bool oldSmooth = p.testRenderHint(QPainter::SmoothPixmapTransform); + if (d->smooth) + p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth); + int w = width(); int h = height(); @@ -749,6 +769,11 @@ void QFxText::paintContents(QPainter &p) p.drawPixmap(x, y, d->imgCache); if (needClip) p.restore(); + + if (d->smooth) { + p.setRenderHint(QPainter::Antialiasing, oldAA); + p.setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth); + } } #elif defined(QFX_RENDER_OPENGL2) |