diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-09-03 14:55:59 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-09-04 09:47:55 +0200 |
commit | 5b162837d86c38ecea715627aaf448b2eb23728a (patch) | |
tree | 803714035644800da2fbf555a90f21eee47b3a52 /src | |
parent | 222f22f626d8ae92500da440a4fb5f429da52407 (diff) |
QQuickTextInput: keep floating point precition when calculating offset
Without this patch, positionToRectangle will return a slightly
different rectangle than what ends up being drawn.
Change-Id: Ib1a3936f0fab393d6016d85d63547ec7f3036b7a
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquicktextinput.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index c91b79dd34..e265d04ecc 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1868,9 +1868,9 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData if (d->autoScroll && d->m_textLayout.lineCount() > 0) { QFontMetricsF fm(d->font); // the y offset is there to keep the baseline constant in case we have script changes in the text. - offset = -QPoint(d->hscroll, d->vscroll + d->m_textLayout.lineAt(0).ascent() - fm.ascent()); + offset = -QPointF(d->hscroll, d->vscroll + d->m_textLayout.lineAt(0).ascent() - fm.ascent()); } else { - offset = -QPoint(d->hscroll, d->vscroll); + offset = -QPointF(d->hscroll, d->vscroll); } if (!d->m_textLayout.text().isEmpty() |