ScrollView - Remove separate X and Y scroll properties as these are now redundant... 01/24201/1
authorJulien Heanley <j.heanley@partner.samsung.com>
Tue, 10 Jun 2014 15:25:20 +0000 (16:25 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 17:48:02 +0000 (18:48 +0100)
             This removes 2 constraints and 2 properties from ScrollView

Change-Id: I63c6efd6d7f934e8f013733ac078b681ecac237a
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-base-impl.cpp
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp
capi/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h

index d2cfb05..e346ccb 100644 (file)
@@ -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);
index e1f4073..3f1cf81 100644 (file)
@@ -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")
index e4fe48a..1b987dc 100644 (file)
@@ -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<Vector3>().x, propertyValue.Get<Vector3>().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<float>( mPropertyX,
-                                         LocalSource( mPropertyPrePosition ),
-                                         InternalXConstraint );
-  mScrollMainInternalXConstraint = self.ApplyConstraint( constraint );
-
-  constraint = Constraint::New<float>( 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);
 }
index 7d1e38f..eeec6d5 100644 (file)
@@ -912,8 +912,6 @@ private:
   //ScrollInternalConstraintsPtr mScrollInternalConstraints;
   ActiveConstraint mScrollMainInternalPrePositionConstraint;
   ActiveConstraint mScrollMainInternalPositionConstraint;
-  ActiveConstraint mScrollMainInternalXConstraint;
-  ActiveConstraint mScrollMainInternalYConstraint;
   ActiveConstraint mScrollMainInternalOvershootXConstraint;
   ActiveConstraint mScrollMainInternalOvershootYConstraint;
   ActiveConstraint mScrollMainInternalDeltaConstraint;
index ca6bb4f..8c37842 100644 (file)
@@ -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" );
index b9026d4..3d4027c 100644 (file)
@@ -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