(ScrollView) Remove unused functions
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-impl.cpp
index e4fe48a..ff6fbb9 100644 (file)
@@ -72,27 +72,6 @@ const Vector2 ANGLE_OUTER_CUBE_SWING(Math::PI * 0.5f, Math::PI * 0.5f);  ///< ou
 
 // Helpers ////////////////////////////////////////////////////////////////////////////////////////
 
-// TODO: GetAngle for Vector2 can be moved.
-// GetAngle for Vector3 needs to be measured against a normal/plane.
-
-/**
- * @param[in] vector The 3D vector to be measured
- * @return angle in radians from 0 to 2PI
- */
-float GetAngle(const Vector3& vector)
-{
-  return atan2(vector.y, vector.x) + Math::PI;
-}
-
-/**
- * @param[in] vector The 2D vector to be measured
- * @return angle in radians from 0 to 2PI
- */
-float GetAngle(const Vector2& vector)
-{
-  return atan2(vector.y, vector.x) + Math::PI;
-}
-
 /**
  * Find the vector (distance) from (a) to (b)
  * in domain (start) to (end)
@@ -487,26 +466,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.
@@ -994,7 +953,7 @@ void ScrollView::UpdatePropertyDomain(const Vector3& size)
     domainChanged = true;
     min.y = 0.0f;
     max.y = 0.0f;
-    canScrollHorizontal = false;
+    canScrollVertical = false;
   }
 
   // avoid setting properties if possible, otherwise this will cause an entire update as well as triggering constraints using each property we update
@@ -1113,16 +1072,6 @@ void ScrollView::SetWrapMode(bool enable)
   Self().SetProperty(mPropertyWrap, enable);
 }
 
-int ScrollView::GetRefreshInterval() const
-{
-  return mScrollUpdateDistance;
-}
-
-void ScrollView::SetRefreshInterval(int milliseconds)
-{
-  mScrollUpdateDistance = milliseconds;
-}
-
 int ScrollView::GetScrollUpdateDistance() const
 {
   return mScrollUpdateDistance;
@@ -2013,21 +1962,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 +2677,6 @@ void ScrollView::UpdateMainInternalConstraint()
     self.RemoveConstraint(mScrollMainInternalDeltaConstraint);
     self.RemoveConstraint(mScrollMainInternalFinalConstraint);
     self.RemoveConstraint(mScrollMainInternalRelativeConstraint);
-    self.RemoveConstraint(mScrollMainInternalXConstraint);
-    self.RemoveConstraint(mScrollMainInternalYConstraint);
   }
   if( mScrollMainInternalPrePositionConstraint )
   {
@@ -2807,16 +2740,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);
 }