aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-03 14:55:59 +0200
committerRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-09-04 09:47:55 +0200
commit5b162837d86c38ecea715627aaf448b2eb23728a (patch)
tree803714035644800da2fbf555a90f21eee47b3a52
parent222f22f626d8ae92500da440a4fb5f429da52407 (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>
-rw-r--r--src/quick/items/qquicktextinput.cpp4
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()