summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-01-18 13:31:06 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2017-01-18 14:20:38 +0000
commit88932d4339ea604a1bea8c09aef3945ac348df9c (patch)
tree9db8f9154afb873ecc0db13f8b8e8cccb710d539
parentcfd069181c01bbade16c173a96100819aa719613 (diff)
Android: transform input rectangle correctly
QRect::setX/setY will change both position and size. In this case, the width and/or height of the input rectangle could end up negative. The correct functions to use are moveLeft/moveTop which will preserve the size when changing the position. Task-number: QTBUG-58179 Change-Id: I71a2e38958754dc53e062ad1c780e2337f72ec32 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index 12e85046f8..436e41bad5 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -354,8 +354,8 @@ static QRect inputItemRectangle()
? QHighDpiScaling::factor(window)
: QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
if (pixelDensity != 1.0) {
- rect.setX(rect.x() * pixelDensity);
- rect.setY(rect.y() * pixelDensity);
+ rect.moveLeft(rect.x() * pixelDensity);
+ rect.moveTop(rect.y() * pixelDensity);
rect.setWidth(rect.width() * pixelDensity);
rect.setHeight(rect.height() * pixelDensity);
}