From a94f61063a031444849fb0873f9b267a4f828597 Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Tue, 5 Nov 2013 11:47:31 +0100 Subject: QNX: Fixed "normalPosition" of touch events Pixel positions have to be set in relation to screen size in pixels, not the physical size to calculate the normal position in the range 0..1. Change-Id: I6880fb64b7c3049d657fd081b564b945399b5865 Reviewed-by: Frank Osterfeld Reviewed-by: Kevin Krammer Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index e0dd20c40c..9db62865bb 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -432,10 +432,12 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType) if (w) { // get size of screen which contains window QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w); - QSizeF screenSize = platformScreen->physicalSize(); + QSizeF screenSize = platformScreen->geometry().size(); // update cached position of current touch point - m_touchPoints[touchId].normalPosition = QPointF( static_cast(pos[0]) / screenSize.width(), static_cast(pos[1]) / screenSize.height() ); + m_touchPoints[touchId].normalPosition = + QPointF(static_cast(pos[0]) / screenSize.width(), + static_cast(pos[1]) / screenSize.height()); m_touchPoints[touchId].area = QRectF( pos[0], pos[1], 0.0, 0.0 ); // determine event type and update state of current touch point -- cgit v1.2.3