ScrollView - Fix for incorrect min/max scroll property values 53/24153/1
authorJulien Heanley <j.heanley@partner.samsung.com>
Tue, 10 Jun 2014 18:34:53 +0000 (19:34 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 17:46:55 +0000 (18:46 +0100)
[problem]      Scroll min/max property values would be incorrect
[cause]        UpdatePropertyDomain attempts to avoid setting values if ones requested are the same as current properties. If SetRulerX/Y is called once with incorrect value and a second time with correct value, but same as value before first call, the property value retrieved will still be the old value and evaluate as the same, even though after next update frame this value is changed to same value as the first call
[solution]     Store last set values locally and check against these instead of actual properties.

Change-Id: I62bc6fd3b5f9d8e9cbbb000b90b46fc90c0dd51a
Signed-off-by: Julien Heanley <j.heanley@partner.samsung.com>
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h

index 9d465e4..1964dfa 100644 (file)
@@ -914,8 +914,8 @@ void ScrollView::SetRulerY(RulerPtr ruler)
 void ScrollView::UpdatePropertyDomain(const Vector3& size)
 {
   Actor self = Self();
-  Vector3 min = self.GetProperty<Vector3>(mPropertyPositionMin);
-  Vector3 max = self.GetProperty<Vector3>(mPropertyPositionMax);
+  Vector3 min = mMinScroll;
+  Vector3 max = mMaxScroll;
   bool scrollPositionChanged = false;
   bool domainChanged = false;
 
@@ -984,6 +984,8 @@ void ScrollView::UpdatePropertyDomain(const Vector3& size)
   }
   if( domainChanged )
   {
+    mMinScroll = min;
+    mMaxScroll = max;
     self.SetProperty(mPropertyPositionMin, min );
     self.SetProperty(mPropertyPositionMax, max );
   }
index 1591fb6..9c1b433 100644 (file)
@@ -911,6 +911,10 @@ private:
   RulerPtr mRulerScaleY;
   RulerPtr mRulerRotation;
 
+  // Last property values set to ScrollView
+  Vector3 mMinScroll;
+  Vector3 mMaxScroll;
+
   unsigned int mMinTouchesForPanning;   ///< Minimum number of touches for panning to be used.
   unsigned int mMaxTouchesForPanning;   ///< Maximum number of touches for panning to be used.