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>
This commit is contained in:
Samuel Rødal 2011-09-02 13:48:26 +02:00 committed by Qt by Nokia
parent 070d9c00c4
commit ca320dfc30

View File

@ -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();
}
}