From 0693ff0a718c67c76f26443dafa1ea87bac66eaa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Heli=20Hyv=C3=A4ttinen?= Date: Tue, 12 Jul 2011 17:34:06 +0300 Subject: [PATCH] Ship now moves to correct direction in N950 Had to swap the x and y values and negate the y value to get it right. In waiting for proper ifdefs to start working just outcommented Maemo lines and added Harmattan ones. *Must* use proper ifdefs before merging to master. --- orientationcontrolledgraphicspixmapobject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/orientationcontrolledgraphicspixmapobject.cpp b/orientationcontrolledgraphicspixmapobject.cpp index d86ea23..3bdd28c 100644 --- a/orientationcontrolledgraphicspixmapobject.cpp +++ b/orientationcontrolledgraphicspixmapobject.cpp @@ -65,9 +65,12 @@ void OrientationControlledGraphicsPixmapObject::readRotationSensor() QRotationReading* pSensorData = rotationSensor_.reading(); - int deltay = pSensorData->x(); //yes, you need the "x" value from the sensor for "y" direction in the scene... - int deltax = pSensorData->y(); //...and vice versa + // int deltay = pSensorData->x(); //yes, in Maemo 5 you need the "x" value from the sensor for "y" direction in the scene... + // int deltax = pSensorData->y(); //...and vice versa + int deltay = -pSensorData->y(); //But in Harmattan, you need the "y" value from the sensor for "y" direction in the scene... + int deltax = pSensorData->x(); //...and x for x (when in landscape) + //and you need to reverse the y value // qDebug() << deltax << " " << deltay; -- 1.7.9.5