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().

Change-Id: I4fea7e8168a9c248a744964d4821b774b85a6cf4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9a0098f4b34e88f28d3d5d6d88948dcf8606e7b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Zoltan Gera 2024-02-14 14:56:00 +02:00 committed by Qt Cherry-pick Bot
parent 2cfe7199a2
commit 2a950ce36e

View File

@ -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();