diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-22 12:40:54 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-22 12:58:06 (GMT) |
commit | c3dd4b356e277c8ec2a2634dbae04cdc7e798ca9 (patch) | |
tree | 4098ec4dc81c7098ee5a3efdf809f20441ce0adb /src/gui/text/qtextlayout.cpp | |
parent | d097610e5cddf946b2c16aa68acc6ebd07aa2f44 (diff) | |
download | Qt-c3dd4b356e277c8ec2a2634dbae04cdc7e798ca9.zip Qt-c3dd4b356e277c8ec2a2634dbae04cdc7e798ca9.tar.gz Qt-c3dd4b356e277c8ec2a2634dbae04cdc7e798ca9.tar.bz2 |
Recommit 1ebeb971d3382aec0fff927
This reverts commit 725c2c29c192349016b1332824a7716bbb992f31 which reverted
the original commit because of a test failure on qws. This recommit adds
a test for whether the metrics from QFontEngine::boundingBox() are valid,
which is required for the bearings to be calculated. This test was also
in the original logic.
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 204effa..3c0e85e 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1688,9 +1688,9 @@ namespace { if (currentPosition <= 0) return; - glyph_metrics_t gi = fontEngine->boundingBox(currentGlyph()); - if (gi.isValid()) - rightBearing = qMin(QFixed(), gi.xoff - gi.x - gi.width); + qreal rb; + fontEngine->getGlyphBearings(currentGlyph(), 0, &rb); + rightBearing = qMin(QFixed(), QFixed::fromReal(rb)); } inline void resetRightBearing() |