From 472028c1d43ec5fc9c8f054f24d286aa7873ad26 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 13 Oct 2011 08:55:56 +0300 Subject: Calculate an area in the touchscreen qpa plugin. Instead of ignoring the touch major/minor and returning a rectangle with width and height of 1, the size of the area is now calculated based on the major. This is incomplete and far from perfect but at least it makes visualizers, like the fingerpaint example app, work out of the box. Change-Id: I3bb70b4d7247f289e5cae4e7de2460ecf2c9d009 Reviewed-on: http://codereview.qt-project.org/6566 Reviewed-by: Paul Olav Tvete --- src/plugins/generic/touchscreen/qtoucheventsenderqpa.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/generic/touchscreen/qtoucheventsenderqpa.cpp') diff --git a/src/plugins/generic/touchscreen/qtoucheventsenderqpa.cpp b/src/plugins/generic/touchscreen/qtoucheventsenderqpa.cpp index 341d38773b..284330fd32 100644 --- a/src/plugins/generic/touchscreen/qtoucheventsenderqpa.cpp +++ b/src/plugins/generic/touchscreen/qtoucheventsenderqpa.cpp @@ -102,7 +102,8 @@ void QTouchEventSenderQPA::touch_point(QEvent::Type state, // Generate a screen position that is always inside the active window or the default screen. const int wx = winRect.left() + int(nx * winRect.width()); const int wy = winRect.top() + int(ny * winRect.height()); - tp.area.moveTopLeft(QPoint(wx, wy)); + const qreal sizeRatio = (winRect.width() + winRect.height()) / qreal(hw_w + hw_h); + tp.area = QRect(wx, wy, tp.area.width() * sizeRatio, tp.area.height() * sizeRatio); #ifdef POINT_DEBUG qDebug() << " " << i << tp.area << tp.state << tp.id << tp.isPrimary << tp.pressure; -- cgit v1.2.3