summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-07-15 13:08:38 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-07-15 13:08:38 (GMT)
commit8cda4ebd5611a6680cd311ff7cadfcc43c6f1686 (patch)
tree9f1813234d33b577951e21eee7d81f65c1f20769 /src/openvg
parent03c01176ebf423085e56ceabcf8335ca5027a786 (diff)
parent77edce14629b665924e89b1f22f902ceb010c964 (diff)
downloadQt-8cda4ebd5611a6680cd311ff7cadfcc43c6f1686.zip
Qt-8cda4ebd5611a6680cd311ff7cadfcc43c6f1686.tar.gz
Qt-8cda4ebd5611a6680cd311ff7cadfcc43c6f1686.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: bin/syncqt src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/page/FrameView.h src/3rdparty/webkit/WebCore/platform/ScrollView.cpp src/3rdparty/webkit/WebCore/platform/ScrollView.h src/corelib/plugin/quuid.cpp src/gui/dialogs/qfontdialog.cpp src/multimedia/audio/qaudiodevicefactory.cpp src/opengl/qgl.cpp src/openvg/qpaintengine_vg.cpp tests/auto/qxmlquery/tst_qxmlquery.cpp
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpaintengine_vg.cpp14
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