From: Julien Heanley Date: Thu, 5 Jun 2014 09:31:56 +0000 (+0100) Subject: Pan Gestures - Changed pan gesture prediction units to millis X-Git-Tag: dali_1.0.0~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08dff36d221397b2723fdc30671bbcaab66dc045;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Pan Gestures - Changed pan gesture prediction units to millis Change-Id: I213e92bbc09a34253bda0ec0c23740d234d5bb32 Signed-off-by: Julien Heanley --- diff --git a/adaptors/base/environment-options.cpp b/adaptors/base/environment-options.cpp index 6855d52..9fe6b23 100644 --- a/adaptors/base/environment-options.cpp +++ b/adaptors/base/environment-options.cpp @@ -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; } diff --git a/adaptors/base/environment-options.h b/adaptors/base/environment-options.h index 5376f9e..2cd16a0 100644 --- a/adaptors/base/environment-options.h +++ b/adaptors/base/environment-options.h @@ -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: diff --git a/adaptors/tizen/internal/common/adaptor-impl.cpp b/adaptors/tizen/internal/common/adaptor-impl.cpp index 157dd0d..e20d44b 100644 --- a/adaptors/tizen/internal/common/adaptor-impl.cpp +++ b/adaptors/tizen/internal/common/adaptor-impl.cpp @@ -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); }