From: Julien Heanley Date: Tue, 10 Jun 2014 15:25:20 +0000 (+0100) Subject: ScrollView - Remove separate X and Y scroll properties as these are now redundant... X-Git-Tag: dali_1.0.0~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=76c42195715d4f991a701890a01425f02041c5b7 ScrollView - Remove separate X and Y scroll properties as these are now redundant and only mirror the pre position Vector3 property. This removes 2 constraints and 2 properties from ScrollView Change-Id: I63c6efd6d7f934e8f013733ac078b681ecac237a Signed-off-by: Julien Heanley Signed-off-by: Adeel Kazmi --- diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp index d2cfb05..e346ccb 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.cpp @@ -38,8 +38,6 @@ ScrollBase::ScrollBase() : Scrollable(), mParent(NULL), mPropertyTime(Property::INVALID_INDEX), - mPropertyX(Property::INVALID_INDEX), - mPropertyY(Property::INVALID_INDEX), mPropertyPrePosition(Property::INVALID_INDEX), mPropertyPosition(Property::INVALID_INDEX), mPropertyScale(Property::INVALID_INDEX), @@ -75,8 +73,6 @@ void ScrollBase::RegisterProperties() mPropertyOvershootX = self.RegisterProperty(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME, 0.0f); mPropertyOvershootY = self.RegisterProperty(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME, 0.0f); mPropertyFinal = self.RegisterProperty(Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME, Vector3::ZERO); - mPropertyX = self.RegisterProperty(Toolkit::ScrollView::SCROLL_X_PROPERTY_NAME, 0.0f); - mPropertyY = self.RegisterProperty(Toolkit::ScrollView::SCROLL_Y_PROPERTY_NAME, 0.0f); mPropertyScale = self.RegisterProperty(Toolkit::ScrollView::SCROLL_SCALE_PROPERTY_NAME, Vector3::ONE); mPropertyWrap = self.RegisterProperty(Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME, false); mPropertyPanning = self.RegisterProperty(Toolkit::ScrollView::SCROLL_PANNING_PROPERTY_NAME, false); diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h index e1f4073..3f1cf81 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h @@ -199,8 +199,6 @@ protected: ScrollBase *mParent; ///< Pointer to ScrollBase parent, if exists. Property::Index mPropertyTime; ///< Scroll Time (0 to animationDuration while animating, otherwise 0) - Property::Index mPropertyX; ///< Scroll Position X ("scroll-x") - Property::Index mPropertyY; ///< Scroll Position Y ("scroll-y") Property::Index mPropertyPrePosition; ///< Scroll Position ("scroll-position") [function of scroll-x, scroll-y] Property::Index mPropertyPosition; ///< Scroll Position ("scroll-position") [function of scroll-pre-position] Property::Index mPropertyScale; ///< Scroll Scale ("scroll-scale") 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 e4fe48a..1b987dc 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 @@ -487,26 +487,6 @@ struct OvershootYConstraint }; /** - * When panning, this constraint updates the X property, otherwise - * it has no effect on the X property. - */ -float InternalXConstraint(const float& current, - const PropertyInput& scrollPosition) -{ - return scrollPosition.GetVector3().x; -} - -/** - * When panning, this constraint updates the Y property, otherwise - * it has no effect on the Y property. - */ -float InternalYConstraint(const float& current, - const PropertyInput& scrollPosition) -{ - return scrollPosition.GetVector3().y; -} - -/** * Internal Position-Delta Property Constraint. * * Generates position-delta property based on scroll-position + scroll-offset properties. @@ -2013,21 +1993,7 @@ void ScrollView::OnChildRemove(Actor& child) void ScrollView::OnPropertySet( Property::Index index, Property::Value propertyValue ) { Actor self = Self(); - if( index == mPropertyX ) - { - self.GetProperty(mPropertyPrePosition).Get(mScrollPrePosition); - propertyValue.Get(mScrollPrePosition.x); - DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y ); - self.SetProperty(mPropertyPrePosition, mScrollPrePosition); - } - else if( index == mPropertyY ) - { - self.GetProperty(mPropertyPrePosition).Get(mScrollPrePosition); - propertyValue.Get(mScrollPrePosition.y); - DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y ); - self.SetProperty(mPropertyPrePosition, mScrollPrePosition); - } - else if( index == mPropertyPrePosition ) + if( index == mPropertyPrePosition ) { DALI_LOG_SCROLL_STATE("[0x%X]: mPropertyPrePosition[%.2f, %.2f]", this, propertyValue.Get().x, propertyValue.Get().y); propertyValue.Get(mScrollPrePosition); @@ -2742,8 +2708,6 @@ void ScrollView::UpdateMainInternalConstraint() self.RemoveConstraint(mScrollMainInternalDeltaConstraint); self.RemoveConstraint(mScrollMainInternalFinalConstraint); self.RemoveConstraint(mScrollMainInternalRelativeConstraint); - self.RemoveConstraint(mScrollMainInternalXConstraint); - self.RemoveConstraint(mScrollMainInternalYConstraint); } if( mScrollMainInternalPrePositionConstraint ) { @@ -2807,16 +2771,6 @@ void ScrollView::UpdateMainInternalConstraint() InternalRelativePositionConstraint ); mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint ); - constraint = Constraint::New( mPropertyX, - LocalSource( mPropertyPrePosition ), - InternalXConstraint ); - mScrollMainInternalXConstraint = self.ApplyConstraint( constraint ); - - constraint = Constraint::New( mPropertyY, - LocalSource( mPropertyPrePosition ), - InternalYConstraint ); - mScrollMainInternalYConstraint = self.ApplyConstraint( constraint ); - // When panning we want to make sure overshoot values are affected by pre position and post position SetOvershootConstraintsEnabled(!mWrapMode); } 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 7d1e38f..eeec6d5 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 @@ -912,8 +912,6 @@ private: //ScrollInternalConstraintsPtr mScrollInternalConstraints; ActiveConstraint mScrollMainInternalPrePositionConstraint; ActiveConstraint mScrollMainInternalPositionConstraint; - ActiveConstraint mScrollMainInternalXConstraint; - ActiveConstraint mScrollMainInternalYConstraint; ActiveConstraint mScrollMainInternalOvershootXConstraint; ActiveConstraint mScrollMainInternalOvershootYConstraint; ActiveConstraint mScrollMainInternalDeltaConstraint; diff --git a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp index ca6bb4f..8c37842 100644 --- a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp +++ b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp @@ -279,8 +279,6 @@ const std::string ScrollView::SCROLL_PRE_POSITION_PROPERTY_NAME( "scroll-pre-pos const std::string ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME( "scroll-overshoot-x" ); const std::string ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME( "scroll-overshoot-y" ); const std::string ScrollView::SCROLL_FINAL_PROPERTY_NAME( "scroll-final" ); -const std::string ScrollView::SCROLL_X_PROPERTY_NAME( "scroll-x" ); -const std::string ScrollView::SCROLL_Y_PROPERTY_NAME( "scroll-y" ); const std::string ScrollView::SCROLL_SCALE_PROPERTY_NAME( "scroll-scale" ); const std::string ScrollView::SCROLL_WRAP_PROPERTY_NAME( "scroll-wrap" ); const std::string ScrollView::SCROLL_PANNING_PROPERTY_NAME( "scroll-panning" ); diff --git a/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h index b9026d4..3d4027c 100644 --- a/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -407,8 +407,6 @@ public: static const std::string SCROLL_OVERSHOOT_X_PROPERTY_NAME; ///< Property, name "scroll-overshoot-x", type float static const std::string SCROLL_OVERSHOOT_Y_PROPERTY_NAME; ///< Property, name "scroll-overshoot-y", type float static const std::string SCROLL_FINAL_PROPERTY_NAME; ///< Property, name "scroll-final", type VECTOR3 - static const std::string SCROLL_X_PROPERTY_NAME; ///< Property, name "scroll-x", type FLOAT - static const std::string SCROLL_Y_PROPERTY_NAME; ///< Property, name "scroll-y", type FLOAT static const std::string SCROLL_SCALE_PROPERTY_NAME; ///< Property, name "scroll-scale", type VECTOR3 static const std::string SCROLL_WRAP_PROPERTY_NAME; ///< Property, name "scroll-wrap", type BOOLEAN static const std::string SCROLL_PANNING_PROPERTY_NAME; ///< Property, name "scroll-panning", type BOOLEAN