From 60afabc94b569253925cbad5766fd6b4d860f757 Mon Sep 17 00:00:00 2001 From: Julien Heanley Date: Tue, 10 Jun 2014 19:34:53 +0100 Subject: [PATCH] ScrollView - Fix for incorrect min/max scroll property values [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 Signed-off-by: Adeel Kazmi --- .../internal/controls/scrollable/scroll-view/scroll-view-impl.cpp | 6 ++++-- .../internal/controls/scrollable/scroll-view/scroll-view-impl.h | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index 9d465e4..1964dfa 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -914,8 +914,8 @@ void ScrollView::SetRulerY(RulerPtr ruler) void ScrollView::UpdatePropertyDomain(const Vector3& size) { Actor self = Self(); - Vector3 min = self.GetProperty(mPropertyPositionMin); - Vector3 max = self.GetProperty(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 ); } diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h index 1591fb6..9c1b433 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h @@ -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. -- 2.7.4