diff options
author | Zoltan Gera <zoltan.gera@qt.io> | 2024-02-14 14:56:00 +0200 |
---|---|---|
committer | Zoltan Gera <zoltan.gera@qt.io> | 2024-02-16 15:20:50 +0200 |
commit | 9a0098f4b34e88f28d3d5d6d88948dcf8606e7b3 (patch) | |
tree | 44c7053430962199ebf58f73f1aa16b011ebf67f /src/plugins/platforms | |
parent | 039b2e4e5dca0fbf98a10fe548467034eeddf117 (diff) |
Android: Do not double finger size for touch events
Fingers in touch events are modelled by rotated ellipses with their
major and minor axes stored respectively. The axis is the diameter of
the ellipse in one direction, not its radius. These values should be
converted to a rectangle correctly, without doubling their extents.
The pair of this fixed code is located in function
QWindowSystemInterfacePrivate::fromNativeTouchPoints().
Pick-to: 6.7
Change-Id: I4fea7e8168a9c248a744964d4821b774b85a6cf4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/android/androidjniinput.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 9ae39269fb..00e6b7ca51 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -287,10 +287,10 @@ namespace QtAndroidInput touchPoint.rotation = qRadiansToDegrees(rotation); touchPoint.normalPosition = QPointF(double(x / dw), double(y / dh)); touchPoint.state = state; - touchPoint.area = QRectF(x - double(minor), - y - double(major), - double(minor * 2), - double(major * 2)); + touchPoint.area = QRectF(x - double(minor * 0.5f), + y - double(major * 0.5f), + double(minor), + double(major)); m_touchPoints.push_back(touchPoint); if (state == QEventPoint::State::Pressed) { QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext(); |