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>
bb10
Zoltan Gera 2024-02-14 14:56:00 +02:00
parent 039b2e4e5d
commit 9a0098f4b3
1 changed files with 4 additions and 4 deletions

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