diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-04 15:19:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-04 15:19:32 (GMT) |
commit | 7890dfe4e1fcb038a96768bb9be71cef126ae2ab (patch) | |
tree | 7be5571774867730b7d89f7e7ab86273638f7d3e | |
parent | 22364344c93917a8b7bf93b4ea236a1a1b1a4b50 (diff) | |
parent | 22e95ba2502f893d741b774c37fc8c7bdc4b05c5 (diff) | |
download | Qt-7890dfe4e1fcb038a96768bb9be71cef126ae2ab.zip Qt-7890dfe4e1fcb038a96768bb9be71cef126ae2ab.tar.gz Qt-7890dfe4e1fcb038a96768bb9be71cef126ae2ab.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Improving text coordinate rounding in the OpenVG paint engine
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index e368c32..318e2b1 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -76,6 +76,9 @@ QT_BEGIN_NAMESPACE #if !defined(QVG_NO_DRAW_GLYPHS) +// use the same rounding as in qrasterizer.cpp (6 bit fixed point) +static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; + Q_DECL_IMPORT extern int qt_defaultDpiX(); Q_DECL_IMPORT extern int qt_defaultDpiY(); @@ -3439,9 +3442,10 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) // Set the transformation to use for drawing the current glyphs. QTransform glyphTransform(d->pathTransform); 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)); + // Prevent blurriness of unscaled, unrotated text by forcing integer coordinates. + glyphTransform.translate( + floor(p.x() + glyphTransform.dx() + aliasedCoordinateDelta) - glyphTransform.dx(), + floor(p.y() - glyphTransform.dy() + aliasedCoordinateDelta) + glyphTransform.dy()); } else { glyphTransform.translate(p.x(), p.y()); } |