From 88932d4339ea604a1bea8c09aef3945ac348df9c Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 18 Jan 2017 13:31:06 +0100 Subject: 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 --- src/plugins/platforms/android/qandroidinputcontext.cpp | 4 ++-- 1 file 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); } -- cgit v1.2.3