summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2011-01-11 11:14:23 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-01-12 08:29:23 (GMT)
commit4e5544b2607e1e981eeb1df7e565d8ff35b66985 (patch)
treee264d1239aad6fc452abbaa9324b2d27f97d00f8
parent925125dfb815fce921d8295d982317171cdf5e73 (diff)
downloadQt-4e5544b2607e1e981eeb1df7e565d8ff35b66985.zip
Qt-4e5544b2607e1e981eeb1df7e565d8ff35b66985.tar.gz
Qt-4e5544b2607e1e981eeb1df7e565d8ff35b66985.tar.bz2
OpenVG paint engine doesn't draw glyphs well to non-integer offsets.
Solution is to round adjustment offsets to integer values to prevent blurry text. Task-number: QTBUG-16240 Reviewed-by: Alessandro Portale (cherry picked from commit e0ed2387bc818f11b16460b0150d4ea75bcf37d6)
-rw-r--r--src/openvg/qpaintengine_vg.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index d2304e7..09cbc36 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3539,8 +3539,8 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
QVarLengthArray<VGfloat> adjustments_x(numGlyphs);
QVarLengthArray<VGfloat> adjustments_y(numGlyphs);
for (int i = 1; i < numGlyphs; ++i) {
- adjustments_x[i-1] = (positions[i].x - positions[i-1].x).toReal();
- adjustments_y[i-1] = (positions[i].y - positions[i-1].y).toReal();
+ adjustments_x[i-1] = (positions[i].x - positions[i-1].x).round().toReal();
+ adjustments_y[i-1] = (positions[i].y - positions[i-1].y).round().toReal();
}
// Set the glyph drawing origin.