diff options
| author | Vladimir Belyavsky <belyavskyv@gmail.com> | 2023-01-10 17:59:44 +0300 |
|---|---|---|
| committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-01-11 12:44:35 +0000 |
| commit | 5d082dc9b87cfce68676f2fc1666a54afd8399b1 (patch) | |
| tree | 2708b7c83d27890b61a8975aef9ad5f30c36da02 /src/quick/items/qquicktextnodeengine.cpp | |
| parent | 6b4939df5cd9c8f0ab37a020fb076de56787fa46 (diff) | |
Fix positioning of text decoration with some fonts
Actually it just reverts 4db31cbd4e29cf5387f4332537f8ea9e0e9f62ae.
When calculating a position for a decoration, we should just apply the
decoration's offset to the line's baseline (line.y + line.ascent).
The regression was introduced by 54b5287adf4f5b004fcf47840c7f2e1e561a90c1
in Qt 5.6, when we switched from prepending leading to the baseline
of text and started appending it instead.
Pick-to: 5.15 6.2 6.4 6.5
Fixes: QTBUG-96700
Fixes: QTBUG-97594
Change-Id: I7f816b71859ffcb6b1c641f0c8b8e1d810bfc525
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextnodeengine.cpp')
| -rw-r--r-- | src/quick/items/qquicktextnodeengine.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index d47bb7c3f3..d2256128cf 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -175,10 +175,7 @@ void QQuickTextNodeEngine::addTextDecorations(const QVarLengthArray<TextDecorati { QRectF &rect = textDecoration.rect; - rect.setY(qRound(rect.y() - + m_currentLine.ascent() - + (m_currentLine.leadingIncluded() ? m_currentLine.leading() : qreal(0.0f)) - + offset)); + rect.setY(qRound(rect.y() + m_currentLine.ascent() + offset)); rect.setHeight(thickness); } |
