Pan Gestures - Changed pan gesture prediction units to millis
authorJulien Heanley <j.heanley@partner.samsung.com>
Thu, 5 Jun 2014 09:31:56 +0000 (10:31 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 10 Jun 2014 15:59:58 +0000 (16:59 +0100)
Change-Id: I213e92bbc09a34253bda0ec0c23740d234d5bb32
Signed-off-by: Julien Heanley <j.heanley@partner.samsung.com>
adaptors/base/environment-options.cpp
adaptors/base/environment-options.h
adaptors/tizen/internal/common/adaptor-impl.cpp

index 6855d52..9fe6b23 100644 (file)
@@ -100,7 +100,7 @@ void EnvironmentOptions::SetPanGesturePredictionMode(unsigned int mode)
   mPanGesturePredictionMode = mode;
 }
 
-void EnvironmentOptions::SetPanGesturePredictionAmount(float amount)
+void EnvironmentOptions::SetPanGesturePredictionAmount(unsigned int amount)
 {
   mPanGesturePredictionAmount = amount;
 }
index 5376f9e..2cd16a0 100644 (file)
@@ -109,9 +109,9 @@ public:
   /**
    * @brief Sets the prediction amount of the pan gesture
    *
-   * @param[in] amount The prediction amount, 0.0f being next vsync and each 1.0f on top is another vsync ahead, can be divisions of (0.5f)
+   * @param[in] amount The prediction amount in milliseconds
    */
-  void SetPanGesturePredictionAmount(float amount);
+  void SetPanGesturePredictionAmount(unsigned int amount);
 
 private:
 
index 157dd0d..e20d44b 100644 (file)
@@ -144,9 +144,14 @@ void Adaptor::ParseEnvironmentOptions()
   {
     mEnvironmentOptions.SetPanGesturePredictionMode(predictionMode);
   }
-  float predictionAmount = -1.0f;
-  if( GetFloatEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) )
+  int predictionAmount = -1;
+  if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) )
   {
+    if( predictionAmount < 0 )
+    {
+      // do not support times in the past
+      predictionAmount = 0;
+    }
     mEnvironmentOptions.SetPanGesturePredictionAmount(predictionAmount);
   }