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 <frank.osterfeld@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
This commit is contained in:
Bernd Weimer 2013-11-05 11:47:31 +01:00 committed by The Qt Project
parent 96d74313fe
commit a94f61063a

View File

@ -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<qreal>(pos[0]) / screenSize.width(), static_cast<qreal>(pos[1]) / screenSize.height() );
m_touchPoints[touchId].normalPosition =
QPointF(static_cast<qreal>(pos[0]) / screenSize.width(),
static_cast<qreal>(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