(PanGestures)PropertyOwner.ResetDefaultProperties is now called on PanGestures
authorJulien Heanley <j.heanley@partner.samsung.com>
Tue, 25 Mar 2014 11:21:18 +0000 (11:21 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Thu, 3 Apr 2014 16:06:15 +0000 (17:06 +0100)
[Issue#]   N/A
[Problem]  PanGesture properties were never being reset and so would cause constraints to be updated every update frame
[Cause]
[Solution] Implemented ResetDefaultProperties

Signed-off-by: Paul Wisbey <p.wisbey@samsung.com>
dali/internal/update/gestures/gesture-properties.h
dali/internal/update/gestures/scene-graph-pan-gesture.cpp
dali/internal/update/manager/update-manager.cpp

index 1e707ff..c6b079c 100644 (file)
@@ -100,6 +100,14 @@ public:
   }
 
   /**
+   * @brief Resets mInputChanged back to false
+   */
+  void Reset()
+  {
+    mInputChanged = false;
+  }
+
+  /**
    * Set the property value.
    * @param[in] value The new property value.
    */
index 19422d9..a5f6631 100644 (file)
@@ -123,7 +123,10 @@ const GesturePropertyVector2& PanGesture::GetLocalDisplacementProperty() const
 
 void PanGesture::ResetDefaultProperties( BufferIndex updateBufferIndex )
 {
-  // Nothing to do
+  mScreenPosition.Reset();
+  mScreenDisplacement.Reset();
+  mLocalPosition.Reset();
+  mLocalDisplacement.Reset();
 }
 
 PanGesture::PanGesture()
index 921030b..8ef61fa 100644 (file)
@@ -785,12 +785,18 @@ void UpdateManager::ResetProperties()
     (*iter)->ResetToBaseValues( mSceneGraphBuffers.GetUpdateBufferIndex() );
   }
 
-  // Reset animatable animatable mesh properties to base values
+  // Reset animatable mesh properties to base values
   for ( AnimatableMeshIter iter = mImpl->animatableMeshes.Begin(); iter != mImpl->animatableMeshes.End(); ++iter )
   {
     (*iter)->ResetToBaseValues( mSceneGraphBuffers.GetUpdateBufferIndex() );
   }
 
+  // Reset gesture properties to base values
+  for ( GestureIter iter = mImpl->gestures.Begin(); iter != mImpl->gestures.End(); ++iter )
+  {
+    (*iter)->ResetToBaseValues( mSceneGraphBuffers.GetUpdateBufferIndex() );
+  }
+
   PERF_MONITOR_END(PerformanceMonitor::RESET_PROPERTIES);
 }