(ScrollView) Remove redundant scaling & rotation functionality 96/24196/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 27 Jun 2014 07:06:31 +0000 (16:06 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 17:47:58 +0000 (18:47 +0100)
[problem]     ScrollView, as the name suggests, should only scroll, not scale or rotate.
              Scaling and rotation does not work propertly so there are a lot of calculations
              which are not needed.
[solution]    Remove scaling functionality and deprecate APIs.

Change-Id: I22bc2755cfe74753c0063cc9644995c2388eeab0
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
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 578fd89..81c8893 100644 (file)
  *
  */
 
-// INTERNAL INCLUDES
+// CLASS HEADER
+#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
+
+// EXTERNAL INCLUDES
 #include <dali/public-api/events/mouse-wheel-event.h>
+#include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
-#include <dali/integration-api/debug.h>
 
 //#define ENABLED_SCROLL_STATE_LOGGING
 
 #endif
 
 // TODO: Change to two class system:
-// 1. DraggableActor (is an actor which can be dragged anywhere/scaled/rotated, can be set to range using the ruler)
+// 1. DraggableActor (is an actor which can be dragged anywhere, can be set to range using the ruler)
 // 2. ScrollView (contains a draggable actor that can a) be dragged in the negative X, and Y domain, b) has a hitArea for touches)
-// TODO: Rotation
-// TODO: Asymetrical scaling
 // TODO: external components (page and status overlays).
 // TODO: Orientation.
 // TODO: upgrade Vector2/3 to support returning Unit vectors, normals, & cross product (dot product is already provided)
@@ -272,7 +273,6 @@ ScrollView::LockAxis GetLockAxis(const Vector2& panDelta, ScrollView::LockAxis c
  * Generates position property based on current position + gesture displacement.
  * Or generates position property based on positionX/Y.
  * Note: This is the position prior to any clamping at scroll boundaries.
- * TODO: Scale & Rotation Transforms.
  */
 struct InternalPrePositionConstraint
 {
@@ -591,10 +591,7 @@ ScrollView::ScrollView()
 : ScrollBase(),
   mTouchDownTime(0u),
   mGestureStackDepth(0),
-  mRotationDelta(0.0f),
   mScrollStateFlags(0),
-  mScrollPreRotation(0.0f),
-  mScrollPostRotation(0.0f),
   mMinTouchesForPanning(1),
   mMaxTouchesForPanning(1),
   mLockAxis(LockPossible),
@@ -652,8 +649,6 @@ void ScrollView::OnInitialize()
   RegisterProperties();
 
   mScrollPostPosition = mScrollPrePosition = Vector3::ZERO;
-  mScrollPostScale = mScrollPreScale = Vector3::ONE;
-  mScrollPostRotation = mScrollPreRotation = 0.0f;
 
   mMouseWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
 
@@ -669,13 +664,8 @@ void ScrollView::OnInitialize()
   // By default we'll allow the user to freely drag the scroll view,
   // while disabling the other rulers.
   RulerPtr ruler = new DefaultRuler();
-  RulerPtr rulerDisabled = new DefaultRuler();
-  rulerDisabled->Disable();
   mRulerX = ruler;
   mRulerY = ruler;
-  mRulerScaleX = rulerDisabled;
-  mRulerScaleY = rulerDisabled;
-  mRulerRotation = rulerDisabled;
 
   EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
 
@@ -1032,24 +1022,6 @@ void ScrollView::UpdatePropertyDomain(const Vector3& size)
   }
 }
 
-void ScrollView::SetRulerScaleX(RulerPtr ruler)
-{
-  mRulerScaleX = ruler;
-  UpdateMainInternalConstraint();
-}
-
-void ScrollView::SetRulerScaleY(RulerPtr ruler)
-{
-  mRulerScaleY = ruler;
-  UpdateMainInternalConstraint();
-}
-
-void ScrollView::SetRulerRotation(RulerPtr ruler)
-{
-  mRulerRotation = ruler;
-  UpdateMainInternalConstraint();
-}
-
 void ScrollView::SetScrollSensitive(bool sensitive)
 {
   Actor self = Self();
@@ -1273,12 +1245,6 @@ void ScrollView::SetScrollPosition(const Vector3& position)
   mScrollPrePosition = position;
 }
 
-Vector3 ScrollView::GetCurrentScrollScale() const
-{
-  // in case animation is currently taking place.
-  return GetPropertyScale();
-}
-
 Vector3 ScrollView::GetDomainSize() const
 {
   Vector3 size = Self().GetCurrentSize();
@@ -1290,13 +1256,13 @@ Vector3 ScrollView::GetDomainSize() const
   return domainSize;
 }
 
-void ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation,
+void ScrollView::TransformTo(const Vector3& position,
                              DirectionBias horizontalBias, DirectionBias verticalBias)
 {
-  TransformTo(position, scale, rotation, mSnapDuration, horizontalBias, verticalBias);
+  TransformTo(position, mSnapDuration, horizontalBias, verticalBias);
 }
 
-void ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration,
+void ScrollView::TransformTo(const Vector3& position, float duration,
                              DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   Actor self( Self() );
@@ -1305,8 +1271,8 @@ void ScrollView::TransformTo(const Vector3& position, const Vector3& scale, floa
   // Note that Emit() methods are called indirectly e.g. from within ScrollView::AnimateTo()
   Toolkit::ScrollView handle( GetOwner() );
 
-  DALI_LOG_SCROLL_STATE("[0x%X] pos[%.2f,%.2f], scale[%.2f,%.2f], rot[%.2f], duration[%.2f] bias[%d, %d]",
-    this, position.x, position.y, scale.x, scale.y, rotation, duration, int(horizontalBias), int(verticalBias));
+  DALI_LOG_SCROLL_STATE("[0x%X] pos[%.2f,%.2f], duration[%.2f] bias[%d, %d]",
+    this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
 
   Vector3 currentScrollPosition = GetCurrentScrollPosition();
   self.SetProperty( mPropertyScrollStartPagePosition, currentScrollPosition );
@@ -1339,10 +1305,6 @@ void ScrollView::TransformTo(const Vector3& position, const Vector3& scale, floa
   mScrollStartedSignalV2.Emit( currentScrollPosition );
   bool animating = AnimateTo(-position,
                              Vector3::ONE * duration,
-                             scale,
-                             Vector3::ONE * duration,
-                             rotation,
-                             duration,
                              mSnapAlphaFunction,
                              true,
                              horizontalBias,
@@ -1385,7 +1347,7 @@ void ScrollView::ScrollTo(const Vector3& position, float duration,
   DALI_LOG_SCROLL_STATE("[0x%X] position[%.2f, %.2f] duration[%.2f]",
     this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
 
-  TransformTo(position, mScrollPostScale, mScrollPostRotation, duration, horizontalBias, verticalBias);
+  TransformTo(position, duration, horizontalBias, verticalBias);
 }
 
 void ScrollView::ScrollTo(unsigned int page)
@@ -1531,17 +1493,6 @@ bool ScrollView::ScrollToSnapPoint()
   return SnapWithVelocity( stationaryVelocity );
 }
 
-void ScrollView::ScaleTo(const Vector3& scale)
-{
-  ScaleTo(scale, mSnapDuration);
-}
-
-void ScrollView::ScaleTo(const Vector3& scale, float duration)
-{
-  TransformTo(mScrollPostPosition, scale, mScrollPostRotation, duration);
-}
-
-
 // TODO: In situations where axes are different (X snap, Y free)
 // Each axis should really have their own independent animation (time and equation)
 // Consider, X axis snapping to nearest grid point (EaseOut over fixed time)
@@ -1558,8 +1509,6 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
   float speed2 = velocity.LengthSquared();
   AlphaFunction alphaFunction = mSnapAlphaFunction;
   Vector3 positionDuration = Vector3::ONE * mSnapDuration;
-  Vector3 scaleDuration = Vector3::ONE * mSnapDuration;
-  float rotationDuration = mSnapDuration;
   float biasX = 0.5f;
   float biasY = 0.5f;
   FindDirection horizontal = None;
@@ -1749,21 +1698,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
   }
   positionSnap += clampDelta;
 
-  // Scale Snap ///////////////////////////////////////////////////////////////
-  Vector3 scaleSnap = mScrollPostScale;
-
-  scaleSnap.x = mRulerScaleX->Snap(scaleSnap.x);
-  scaleSnap.y = mRulerScaleY->Snap(scaleSnap.y);
-
-  ClampScale(scaleSnap);
-
-  // Rotation Snap ////////////////////////////////////////////////////////////
-  float rotationSnap = mScrollPostRotation;
-  // TODO: implement rotation snap
-
   bool animating = AnimateTo(positionSnap, positionDuration,
-                             scaleSnap, scaleDuration,
-                             rotationSnap, rotationDuration,
                              alphaFunction, false,
                              DirectionBiasNone, DirectionBiasNone,
                              isFlick || isFreeFlick ? Flick : Snap);
@@ -1774,7 +1709,6 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
 void ScrollView::StopAnimation(void)
 {
   // Clear Snap animation if exists.
-  StopAnimation(mSnapAnimation);
   StopAnimation(mInternalXAnimation);
   StopAnimation(mInternalYAnimation);
   mScrollStateFlags = 0;
@@ -1792,8 +1726,6 @@ void ScrollView::StopAnimation(Animation& animation)
 }
 
 bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDuration,
-                           const Vector3& scale, const Vector3& scaleDuration,
-                           float rotation, float rotationDuration,
                            AlphaFunction alpha, bool findShortcuts,
                            DirectionBias horizontalBias, DirectionBias verticalBias,
                            SnapType snapType)
@@ -1805,8 +1737,6 @@ bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDurat
   float totalDuration = 0.0f;
 
   bool positionChanged = (mScrollTargetPosition != mScrollPostPosition);
-  bool scaleChanged = (scale != mScrollPostScale);
-  bool rotationChanged = fabsf(rotation - mScrollPostRotation) > Math::MACHINE_EPSILON_0;
 
   if(positionChanged)
   {
@@ -1820,16 +1750,6 @@ bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDurat
     positionChanged = true;
   }
 
-  if(scaleChanged)
-  {
-    totalDuration = std::max(totalDuration, scaleDuration.x);
-    totalDuration = std::max(totalDuration, scaleDuration.y);
-  }
-
-  if(rotationChanged)
-  {
-    totalDuration = std::max(totalDuration, rotationDuration);
-  }
   StopAnimation();
 
   // Position Delta ///////////////////////////////////////////////////////
@@ -1872,35 +1792,12 @@ bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDurat
     DALI_LOG_SCROLL_STATE("[0x%X] mPropertyPrePosition[%.2f, %.2f], mPropertyPosition[%.2f, %.2f]", this, self.GetProperty( mPropertyPrePosition ).Get<Vector3>().x, self.GetProperty( mPropertyPrePosition ).Get<Vector3>().y, self.GetProperty( mPropertyPosition ).Get<Vector3>().x, self.GetProperty( mPropertyPosition ).Get<Vector3>().y );
   }
 
-  // Scale Delta ///////////////////////////////////////////////////////
-  if(scaleChanged)
-  {
-    if(totalDuration > Math::MACHINE_EPSILON_1)
-    {
-      mSnapAnimation = Animation::New(totalDuration);
-      mSnapAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
-      // TODO: for non-uniform scaling to different bounds e.g. scaling a square to a 4:3 aspect ratio screen with a velocity
-      // the height will hit first, and then the width, so that would require two different animation times just like position.
-      mSnapAnimation.AnimateTo( Property(self, mPropertyScale), scale, alpha, TimePeriod(0.0f, scaleDuration.x));
-
-      mSnapAnimation.AnimateTo( Property(self, mPropertyTime), totalDuration, AlphaFunctions::Linear );
-      mSnapAnimation.Play();
-    }
-    else
-    {
-      self.SetProperty(mPropertyScale, scale);
-
-      mScrollPreScale = mScrollPostScale = scale;
-    }
-  }
   SetScrollUpdateNotification(true);
 
   // Always send a snap event when AnimateTo is called.
   Toolkit::ScrollView::SnapEvent snapEvent;
   snapEvent.type = snapType;
   snapEvent.position = -mScrollTargetPosition;
-  snapEvent.scale = scale;
-  snapEvent.rotation = rotation;
   snapEvent.duration = totalDuration;
 
   DALI_LOG_SCROLL_STATE("[0x%X] mSnapStartedSignalV2 [%.2f, %.2f]", this, snapEvent.position.x, snapEvent.position.y);
@@ -1987,11 +1884,6 @@ Vector3 ScrollView::GetPropertyPosition() const
   return position;
 }
 
-Vector3 ScrollView::GetPropertyScale() const
-{
-  return Self().GetProperty<Vector3>(mPropertyScale);
-}
-
 void ScrollView::HandleStoppedAnimation()
 {
   SetScrollUpdateNotification(false);
@@ -2351,13 +2243,7 @@ void ScrollView::PreAnimatedScrollSetup()
 
   mScrollStateFlags = 0;
 
-  mScrollPostScale = GetPropertyScale();
-
   // Update Actor position with this wrapped value.
-  // TODO Rotation
-
-  mScrollPreScale = mScrollPostScale;
-  mScrollPreRotation = mScrollPostRotation;
 }
 
 void ScrollView::FinaliseAnimatedScroll()
@@ -2418,14 +2304,6 @@ void ScrollView::OnScrollAnimationFinished( Animation& source )
   // update our local scroll positions
   UpdateLocalScrollProperties();
 
-  if( source == mSnapAnimation )
-  {
-    DALI_LOG_SCROLL_STATE("[0x%X] mSnapAnimation[0x%X]", this, mSnapAnimation.GetObjectPtr() );
-
-    // generic snap animation used for scaling and rotation
-    mSnapAnimation.Reset();
-  }
-
   if( source == mInternalXAnimation )
   {
     DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(mPropertyPrePosition).Get<Vector3>().x, mScrollPostPosition.x );
@@ -2560,8 +2438,6 @@ void ScrollView::GestureStarted()
     StopTouchDownTimer();
     StopAnimation();
     mPanDelta = Vector3::ZERO;
-    mScaleDelta = Vector3::ONE;
-    mRotationDelta = 0.0f;
     mLastVelocity = Vector2(0.0f, 0.0f);
     if( !mScrolling )
     {
@@ -2590,13 +2466,10 @@ void ScrollView::GestureStarted()
   }
 }
 
-void ScrollView::GestureContinuing(const Vector2& panDelta, const Vector2& scaleDelta, float rotationDelta)
+void ScrollView::GestureContinuing(const Vector2& panDelta)
 {
   mPanDelta.x+= panDelta.x;
   mPanDelta.y+= panDelta.y;
-  mScaleDelta.x*= scaleDelta.x;
-  mScaleDelta.y*= scaleDelta.y;
-  mRotationDelta+= rotationDelta;
 
   // Save the velocity, there is a bug in PanGesture
   // Whereby the Gesture::Finished's velocity is either:
@@ -2612,8 +2485,6 @@ void ScrollView::GestureContinuing(const Vector2& panDelta, const Vector2& scale
 }
 
 // TODO: Upgrade to use a more powerful gesture detector (one that supports multiple touches on pan - so works as pan and flick gesture)
-// TODO: Reimplement Scaling (pinching 2+ points)
-// TODO: Reimplment Rotation (pinching 2+ points)
 // BUG: Gesture::Finished doesn't always return velocity on release (due to
 // timeDelta between last two events being 0 sometimes, or posiiton being the same)
 void ScrollView::OnPan(PanGesture gesture)
@@ -2652,7 +2523,7 @@ void ScrollView::OnPan(PanGesture gesture)
       if ( mPanning )
       {
         DALI_LOG_SCROLL_STATE("[0x%X] Pan Continuing", this);
-        GestureContinuing(gesture.screenDisplacement, Vector2::ZERO, 0.0f);
+        GestureContinuing(gesture.screenDisplacement);
       }
       else
       {
@@ -2742,11 +2613,6 @@ void ScrollView::OnGestureEx(Gesture::State state)
   }
 }
 
-void ScrollView::UpdateTransform()
-{
-// TODO: notify clamps using property notifications (or see if we need this, can deprecate it)
-}
-
 void ScrollView::FinishTransform()
 {
   // at this stage internal x and x scroll position should have followed prescroll position exactly
@@ -2837,18 +2703,6 @@ void ScrollView::ClampPosition(Vector3& position, ClampState3 &clamped) const
 {
   Vector3 size = Self().GetCurrentSize();
 
-  // determine size of viewport relative to current scaled size.
-  // e.g. if you're zoomed in 200%, then each pixel on screen is only 0.5 pixels on subject.
-  if(fabsf(mScrollPostScale.x) > Math::MACHINE_EPSILON_0)
-  {
-    size.x /= mScrollPostScale.x;
-  }
-
-  if(fabsf(mScrollPostScale.y) > Math::MACHINE_EPSILON_0)
-  {
-    size.y /= mScrollPostScale.y;
-  }
-
   position.x = -mRulerX->Clamp(-position.x, size.width, 1.0f, clamped.x);    // NOTE: X & Y rulers think in -ve coordinate system.
   position.y = -mRulerY->Clamp(-position.y, size.height, 1.0f, clamped.y);   // That is scrolling RIGHT (e.g. 100.0, 0.0) means moving LEFT.
 
@@ -2874,19 +2728,6 @@ void ScrollView::WrapPosition(Vector3& position) const
   }
 }
 
-void ScrollView::ClampScale(Vector3& scale) const
-{
-  ClampState3 clamped;
-  ClampScale(scale, clamped);
-}
-
-void ScrollView::ClampScale(Vector3& scale, ClampState3 &clamped) const
-{
-  scale.x = mRulerScaleX->Clamp(scale.x, 0.0f, 1.0f, clamped.x);
-  scale.y = mRulerScaleY->Clamp(scale.y, 0.0f, 1.0f, clamped.y);
-  clamped.z = NotClamped;
-}
-
 void ScrollView::UpdateMainInternalConstraint()
 {
   // TODO: Only update the constraints which have changed, rather than remove all and add all again.
@@ -3026,7 +2867,8 @@ void ScrollView::SetInternalConstraints()
   // self - The ScrollView
 
   // Apply some default constraints to ScrollView.
-  // Movement + Scaling + Wrap function
+  // Movement + Wrap function
+  // TODO: Look into removing some of these constraints
 
   Constraint constraint;
 
index 20215a4..6fc10c9 100644 (file)
@@ -193,22 +193,6 @@ public:
   void SetRulerY(RulerPtr ruler);
 
   /**
-   * @copydoc Toolkit::ScrollView::SetRulerScaleX
-   */
-  void SetRulerScaleX(RulerPtr ruler);
-
-  /**
-   * @copydoc Toolkit::ScrollView::SetRulerScaleY
-   */
-  void SetRulerScaleY(RulerPtr ruler);
-
-  /**
-   * Set Rotation axis ruler (defines how rotating is snapped in radians)
-   * @param[in] ruler The ruler to be used for the Rotation axis
-   */
-  void SetRulerRotation(RulerPtr ruler);
-
-  /**
    * @copydoc Toolkit::ScrollView::SetScrollSensitive
    */
   void SetScrollSensitive(bool sensitive);
@@ -383,25 +367,20 @@ public:
   void SetScrollPosition(const Vector3& position);
 
   /**
-   * @copydoc Toolkit::ScrollView::GetCurrentScrollScale
-   */
-  Vector3 GetCurrentScrollScale() const;
-
-  /**
    * @copydoc Toolkit::Scrollable::GetDomainSize
    */
   Vector3 GetDomainSize() const;
 
   /**
-   * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation)
+   * @copydoc ScrollTo(const Vector3&)
    */
-  void TransformTo(const Vector3& position, const Vector3& scale, float rotation,
+  void TransformTo(const Vector3& position,
                    DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
 
   /**
-   * @copydoc Toolkit::ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration)
+   * @copydoc ScrollTo(const Vector3&, float, DirectionBias, DirectionBias)
    */
-  void TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration,
+  void TransformTo(const Vector3& position, float duration,
                    DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
 
   /**
@@ -474,16 +453,6 @@ public:
   bool ScrollToSnapPoint();
 
   /**
-   * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale)
-   */
-  void ScaleTo(const Vector3& scale);
-
-  /**
-   * @copydoc Toolkit::ScrollView::ScaleTo(const Vector3& scale, float duration)
-   */
-  void ScaleTo(const Vector3& scale, float duration);
-
-  /**
    * Stops animation
    */
   void StopAnimation(void);
@@ -496,14 +465,10 @@ public:
   void StopAnimation(Animation& animation);
 
   /**
-   * Animates to position/scale/rotation transform.
+   * Animates to position transform.
    *
    * @param[in] position The position to animate to
    * @param[in] positionDuration The number of seconds this animation should run for in each axis.
-   * @param[in] scale The scale to animate to
-   * @param[in] scaleDuration The number of seconds this animation should run for in each axis.
-   * @param[in] rotation The angle to animate to
-   * @param[in] rotationDuration The number of seconds this animation should run for in each axis.
    * @param[in] alpha The easing alpha function to use.
    * @param[in] findShortcuts (optional) Whether to find the shortest route (in Wrap mode)
    * @param[in] horizontalBias (optional) Whether to bias animation to left or right (or no biasing)
@@ -511,8 +476,6 @@ public:
    * @return True if animation necessary and taking place to reach desired transform.
    */
   bool AnimateTo(const Vector3& position, const Vector3& positionDuration,
-                             const Vector3& scale, const Vector3& scaleDuration,
-                             float rotation, float rotationDuration,
                              AlphaFunction alpha, bool findShortcuts = true,
                              DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone,
                              SnapType snapType = Snap);
@@ -724,10 +687,8 @@ private:
    * Amalgamated Gesture Continuing event
    *
    * @param[in] panDelta average panning delta from base position (0)
-   * @param[in] scaleDelta average scale delta from base scale (1)
-   * @param[in] rotationDelta average rotation delta from base angle (0)
    */
-  void GestureContinuing(const Vector2& panDelta, const Vector2& scaleDelta, float rotationDelta);
+  void GestureContinuing(const Vector2& panDelta);
 
   /**
    * Called upon pan gesture event.
@@ -752,12 +713,6 @@ private:
   bool SnapWithVelocity(Vector2 velocity);
 
   /**
-   * Updates Container Transform based on Pan, Scale, and Rotation props.
-   * (occurs when continuing gesture i.e. dragging/pinching.)
-   */
-  void UpdateTransform();
-
-  /**
    * Finishes Container Transform
    * (occurs upon finishing gesture i.e. releasing)
    */
@@ -803,21 +758,6 @@ private:
   void WrapPosition(Vector3& position) const;
 
   /**
-   * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers
-   *
-   * @param[in,out] scale The scale you wish to clamp
-   */
-  void ClampScale(Vector3& scale) const;
-
-  /**
-   * Clamps scale within the domain set up by Scale-X/Scale-Y Rulers
-   *
-   * @param[in,out] scale The scale you wish to clamp
-   * @param[out] clamped The results of the clamping.
-   */
-  void ClampScale(Vector3& scale, ClampState3 &clamped) const;
-
-  /**
    * Updates the main internal scroll constraints with new ruler and domain
    * values
    */
@@ -874,22 +814,15 @@ private:
   Vector3 GetPropertyPosition() const;
 
   /**
-   * Gets scale property.
-   *
-   * @return The current scale
-   */
-  Vector3 GetPropertyScale() const;
-
-  /**
-   * Handles a Stopped animation. Its position/scale/rotation properties need to be
-   * saved, and the animation flag switched off.
+   * Handles a Stopped animation. Its position properties need to be saved, and the animation flag
+   * switched off.
    */
   void HandleStoppedAnimation();
 
   /**
    * Handles a Stopped animation (whether the animation completed, or was
-   * manually stopped). Its position/scale/rotation properties need to be
-   * saved, and the animation flag switched off.
+   * manually stopped). Its position properties need to be saved, and the
+   * animation flag switched off.
    */
   void HandleSnapAnimationFinished();
 
@@ -919,26 +852,17 @@ private:
   int mGestureStackDepth;               ///< How many gestures are currently occuring.
 
   Vector3 mPanDelta;                    ///< Amount currently panned.
-  Vector3 mScaleDelta;                  ///< Amount currently scaled.
-  float mRotationDelta;                 ///< Amount currently rotated.
 
   unsigned int mScrollStateFlags;       ///< flags indicating current state of scrolling
-  // Scroll delegate pre and post position/scale/rotation properties...
+  // Scroll delegate pre and post position properties...
   Vector3 mScrollPrePosition;           ///< Wrapped scroll position, but not clamped
   Vector3 mScrollPostPosition;          ///< Wrapped and clamped, this is the final scroll position used
   Vector3 mScrollTargetPosition;        ///< Final target position for an animated scroll
-  Vector3 mScrollPreScale;              ///< Scroll delegate pre-scale
-  Vector3 mScrollPostScale;             ///< Scroll delegate post-scale (affected by current touch)
-  float mScrollPreRotation;             ///< Scroll delegate pre-rotation
-  float mScrollPostRotation;            ///< Scroll delegate post-rotation (affected by current touch)
   Vector3 mDomainOffset;                ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
 
   // Rulers for each axes...
   RulerPtr mRulerX;
   RulerPtr mRulerY;
-  RulerPtr mRulerScaleX;
-  RulerPtr mRulerScaleY;
-  RulerPtr mRulerRotation;
 
   // Last property values set to ScrollView
   Vector3 mMinScroll;
@@ -947,7 +871,6 @@ private:
   unsigned int mMinTouchesForPanning;   ///< Minimum number of touches for panning to be used.
   unsigned int mMaxTouchesForPanning;   ///< Maximum number of touches for panning to be used.
 
-  Animation mSnapAnimation;             ///< Used to animate rotation and scaling of scroll properties
   Animation mInternalXAnimation;        ///< Animates mPropertyX to a snap position or application requested scroll position
   Animation mInternalYAnimation;        ///< Animates mPropertyY to a snap position or application requested scroll position
 
index aba1054..db5797e 100644 (file)
  *
  */
 
-#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
+// CLASS HEADER
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
 
 using namespace Dali;
@@ -385,12 +391,12 @@ void ScrollView::SetRulerY(RulerPtr ruler)
 
 void ScrollView::SetRulerScaleX(RulerPtr ruler)
 {
-  GetImpl(*this).SetRulerScaleX(ruler);
+  DALI_LOG_ERROR( "Deprecated" );
 }
 
 void ScrollView::SetRulerScaleY(RulerPtr ruler)
 {
-  GetImpl(*this).SetRulerScaleY(ruler);
+  DALI_LOG_ERROR( "Deprecated" );
 }
 
 void ScrollView::SetScrollSensitive(bool sensitive)
@@ -540,7 +546,8 @@ void ScrollView::SetScrollPosition(const Vector3& position)
 
 Vector3 ScrollView::GetCurrentScrollScale() const
 {
-  return GetImpl(*this).GetCurrentScrollScale();
+  DALI_LOG_ERROR( "Deprecated" );
+  return Vector3::ONE;
 }
 
 unsigned int ScrollView::GetCurrentPage() const
@@ -550,12 +557,16 @@ unsigned int ScrollView::GetCurrentPage() const
 
 void ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation)
 {
-  GetImpl(*this).TransformTo(position, scale, rotation);
+  DALI_LOG_ERROR( "Deprecated" );
+
+  GetImpl(*this).TransformTo(position);
 }
 
 void ScrollView::TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration)
 {
-  GetImpl(*this).TransformTo(position, scale, rotation, duration);
+  DALI_LOG_ERROR( "Deprecated" );
+
+  GetImpl(*this).TransformTo(position, duration);
 }
 
 void ScrollView::ScrollTo(const Vector3 &position)
@@ -606,12 +617,12 @@ bool ScrollView::ScrollToSnapPoint()
 
 void ScrollView::ScaleTo(const Vector3 &scale)
 {
-  GetImpl(*this).ScaleTo(scale);
+  DALI_LOG_ERROR( "Deprecated" );
 }
 
 void ScrollView::ScaleTo(const Vector3 &scale, float duration)
 {
-  GetImpl(*this).ScaleTo(scale, duration);
+  DALI_LOG_ERROR( "Deprecated" );
 }
 
 void ScrollView::ApplyConstraintToChildren(Constraint constraint)
index 25ce6c8..b9026d4 100644 (file)
@@ -453,8 +453,6 @@ public:
   {
     SnapType type;    ///< Current snap commencing
     Vector3 position; ///< Target snap position
-    Vector3 scale;    ///< Target snap scale
-    float rotation;   ///< Target snap rotation
     float duration;   ///< Duration of snap animation.
   };
 
@@ -609,6 +607,8 @@ public:
    * (domain) to which scaling can be performed e.g. 10% to 200%
    *
    * @param[in] ruler The ruler to be used for the Scale-X axis
+   *
+   * @deprecated Scaling not supported
    */
   void SetRulerScaleX(RulerPtr ruler);
 
@@ -619,6 +619,8 @@ public:
    * (domain) to which scaling can be performed e.g. 10% to 200%
    *
    * @param[in] ruler The ruler to be used for the Scale-Y axis
+   *
+   * @deprecated Scaling not supported
    */
   void SetRulerScaleY(RulerPtr ruler);
 
@@ -921,6 +923,8 @@ public:
    * @brief Retrieves current scroll scale.
    *
    * @returns The current scroll scale.
+   *
+   * @deprecated Scaling not supported
    */
   Vector3 GetCurrentScrollScale() const;
 
@@ -942,16 +946,20 @@ public:
    * @param[in] position The position to transform to.
    * @param[in] scale The scale to transform to.
    * @param[in] rotation The rotation to transform to.
+   *
+   * @deprecated Scaling or rotation not supported, use ScrollTo(const Vector3&)
    */
   void TransformTo(const Vector3& position, const Vector3& scale, float rotation);
 
   /**
-   * @brief Transforms View to position, scale and rotation specified.
+   * @brief Transforms View to position, scale and rotation specified in the duration specified.
    *
    * @param[in] position The position to transform to.
    * @param[in] scale The scale to transform to.
    * @param[in] rotation The rotation to transform to.
    * @param[in] duration The duration for this animation in seconds.
+   *
+   * @deprecated Scaling or rotation not supported, use ScrollTo(const Vector3&, float)
    */
   void TransformTo(const Vector3& position, const Vector3& scale, float rotation, float duration);
 
@@ -1076,6 +1084,8 @@ public:
    * @brief Scales View to (scale).
    *
    * @param[in] scale The scale factor the animate to.
+   *
+   * @deprecated Scaling not supported
    */
   void ScaleTo(const Vector3& scale);
 
@@ -1084,6 +1094,8 @@ public:
    *
    * @param[in] scale The scale factor the animate to.
    * @param[in] duration The duration of the animation in seconds.
+   *
+   * @deprecated Scaling not supported
    */
   void ScaleTo(const Vector3& scale, float duration);