diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-03 10:53:57 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-03 10:53:57 (GMT) |
commit | d5491ecdde14659a913c9f476f18c45f1d9489bb (patch) | |
tree | 06cc52249feda9bd9e50ca47abb8ebd676c8a309 /src/openvg/qpaintengine_vg.cpp | |
parent | 42cdfaf86d34afeb6448723839fef70fe477deed (diff) | |
parent | a41128af5373a0225c3548abd3eb82cd7e8f7a0e (diff) | |
download | Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.zip Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.tar.gz Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into lighthouse
Conflicts:
configure
Diffstat (limited to 'src/openvg/qpaintengine_vg.cpp')
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 4992ef5..1d633ed 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -55,6 +55,7 @@ #include <QtGui/private/qfontengine_p.h> #include <QtGui/private/qpainterpath_p.h> #include <QtGui/private/qstatictext_p.h> +#include <QtCore/qmath.h> #include <QDebug> #include <QSet> @@ -1610,7 +1611,10 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) // Try converting the path into a QRegion that tightly follows // the outline of the path we want to clip with. - QRegion region(path.convertToPainterPath().toFillPolygon(QTransform()).toPolygon()); + QRegion region; + if (!path.isEmpty()) + region = QRegion(path.convertToPainterPath().toFillPolygon(QTransform()).toPolygon()); + switch (op) { case Qt::NoClip: { @@ -3427,7 +3431,13 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem) // Set the transformation to use for drawing the current glyphs. QTransform glyphTransform(d->pathTransform); - glyphTransform.translate(p.x(), p.y()); + if (d->transform.type() <= QTransform::TxTranslate) { + // Prevent blurriness of unscaled, unrotated text by using integer coordinates. + // Using ceil(x-0.5) instead of qRound() or int-cast, behave like other paint engines. + glyphTransform.translate(ceil(p.x() - 0.5), ceil(p.y() - 0.5)); + } else { + glyphTransform.translate(p.x(), p.y()); + } #if defined(QVG_NO_IMAGE_GLYPHS) glyphTransform.scale(glyphCache->scaleX, glyphCache->scaleY); #endif |