aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-02-18 10:35:00 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2015-02-20 08:49:36 +0000
commit4db31cbd4e29cf5387f4332537f8ea9e0e9f62ae (patch)
tree4656842728e0432b7e17074051891801db4235f2 /src/quick
parent373ce8878321aa561b55131bada78ad4a2ce8427 (diff)
Account for leading when drawing text decoration
When the text line is offset by the leading distance, the text decoration needs to be offset by the same value, otherwise it will be drawn in the wrong location. [ChangeLog][TextEdit] Fixed positioning of text decoration with some fonts. Change-Id: Ic15134326b878255a9b424c14762c3817dfd3123 Task-number: QTBUG-44492 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Andrew Knight <qt@panimo.net> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 9753f5b4f5..2db04ab378 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -191,7 +191,10 @@ void QQuickTextNodeEngine::addTextDecorations(const QVarLengthArray<TextDecorati
{
QRectF &rect = textDecoration.rect;
- rect.setY(qRound(rect.y() + m_currentLine.ascent() + offset));
+ rect.setY(qRound(rect.y()
+ + m_currentLine.ascent()
+ + (m_currentLine.leadingIncluded() ? m_currentLine.leading() : qreal(0.0f))
+ + offset));
rect.setHeight(thickness);
}