Fix Symbian bugs.
[dorian] / widgets / flickcharm.cpp
index 062a6f4..50abe68 100755 (executable)
 \r
 const int fingerAccuracyThreshold = 3;\r
 \r
+#ifdef Q_OS_SYMBIAN\r
+const int maxSpeed = 2000;\r
+const int maxSpeedAutoScroll = 1250;\r
+#else\r
+const int maxSpeed = 4000;\r
+const int maxSpeedAutoScroll = 2500;\r
+#endif\r
+\r
 struct FlickData {\r
     typedef enum {\r
         Steady, // Interaction without scrolling\r
@@ -97,7 +105,7 @@ struct FlickData {
                 const int newSpeedY = (qAbs(pixelsPerSecond.y()) > fingerAccuracyThreshold) ? pixelsPerSecond.y() : 0;\r
                 const int newSpeedX = (qAbs(pixelsPerSecond.x()) > fingerAccuracyThreshold) ? pixelsPerSecond.x() : 0;\r
                 if (state == AutoScrollAcceleration) {\r
-                    const int max = 4000; // px by seconds\r
+                    const int max = maxSpeedAutoScroll; // px by seconds\r
                     const int oldSpeedY = speed.y();\r
                     const int oldSpeedX = speed.x();\r
                     if ((oldSpeedY <= 0 && newSpeedY <= 0) ||  (oldSpeedY >= 0 && newSpeedY >= 0)\r
@@ -108,7 +116,7 @@ struct FlickData {
                         speed = QPoint();\r
                     }\r
                 } else {\r
-                    const int max = 2500; // px by seconds\r
+                    const int max = maxSpeed; // px by seconds\r
                     // we average the speed to avoid strange effects with the last delta\r
                     if (!speed.isNull()) {\r
                         speed.setX(qBound(-max, (speed.x() / 4) + (newSpeedX * 3 / 4), max));\r