summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-09-02 13:48:26 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-20 12:00:33 +0200
commitca320dfc304626e4878d6f1e5d50e070efbfdd85 (patch)
treeafe1e130f95a66380a31708436bfff47e769507f /src/gui
parent070d9c00c488a5ee6811f04170cf488ead79bf80 (diff)
Generate glyphs in un-transformed coordinate system.
Avoids rounding issues with very large coordinates. Task-number: QTBUG-21262 - QRasterPaintEngine & QFontEngineFT - fonts corrupted when scrolling to the bottom of long texts Reviewed-by: Eskil Signed-off-by: Aleksandar Stojiljkovic <aleksandar.stojiljkovic@nokia.com> (cherry picked from commit 43e013e2048e8193e2d31276cac6348a9f6ce340) Change-Id: I5810a1a60f2bbdba4889a6b5e493b183018f3976 Reviewed-on: http://codereview.qt-project.org/5202 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpaintengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index f64bd52ec2..2545cc7cd9 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -756,14 +756,15 @@ void QPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
path.setFillRule(Qt::WindingFill);
#endif
if (ti.glyphs.numGlyphs)
- ti.fontEngine->addOutlineToPath(p.x(), p.y(), ti.glyphs, &path, ti.flags);
+ ti.fontEngine->addOutlineToPath(0, 0, ti.glyphs, &path, ti.flags);
if (!path.isEmpty()) {
- bool oldAA = painter()->renderHints() & QPainter::Antialiasing;
+ painter()->save();
painter()->setRenderHint(QPainter::Antialiasing,
bool((painter()->renderHints() & QPainter::TextAntialiasing)
&& !(painter()->font().styleStrategy() & QFont::NoAntialias)));
+ painter()->translate(p.x(), p.y());
painter()->fillPath(path, state->pen().brush());
- painter()->setRenderHint(QPainter::Antialiasing, oldAA);
+ painter()->restore();
}
}