X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=orientationcontrolledgraphicspixmapobject.cpp;h=272c7cfe6a999cd7f9b5928c72d34bec7fab2c2a;hb=c4e1d101fb178f6df046a6b0bb800a020a81caab;hp=d86ea230c3b1d7a34af22090e02e5b740f936b87;hpb=024ba91057ba3387b9d7328e5d4392d4112be8a8;p=ghostsoverboard diff --git a/orientationcontrolledgraphicspixmapobject.cpp b/orientationcontrolledgraphicspixmapobject.cpp index d86ea23..272c7cf 100644 --- a/orientationcontrolledgraphicspixmapobject.cpp +++ b/orientationcontrolledgraphicspixmapobject.cpp @@ -65,17 +65,25 @@ 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; int oldx = x(); int oldy = y(); - int newx = x() + deltax/15; - int newy = y() + deltay/15; + //this is how it works on maemo +// int newx = x() + deltax/15; +// int newy = y() + deltay/15; + + //this is for Harmattan + int newx = x() + deltax/5; + int newy = y() + deltay/5; // qDebug() << sceneRectangle.left() << sceneRectangle.right();