(ScrollView) Removed unnecessary scale constraints from scroll-view 97/24197/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 27 Jun 2014 09:23:02 +0000 (18:23 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 17:47:59 +0000 (18:47 +0100)
[problem]     ScrollView should not scale itself or its children
[solution]    Remove constraints that do this

Change-Id: I9259643006e4b2d7dc7030bbebe3856e1073a5f8
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp
base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h

index 81c8893..b5a0751 100644 (file)
@@ -2863,27 +2863,15 @@ void ScrollView::SetInternalConstraints()
   // User definable constraints to apply to all child actors //////////////////
   Actor self = Self();
 
   // User definable constraints to apply to all child actors //////////////////
   Actor self = Self();
 
-  // LocalSource - The Actors to be moved.
-  // self - The ScrollView
-
-  // Apply some default constraints to ScrollView.
+  // Apply some default constraints to ScrollView & its bound actors
   // Movement + Wrap function
   // Movement + Wrap function
-  // TODO: Look into removing some of these constraints
 
   Constraint constraint;
 
 
   Constraint constraint;
 
-  // MoveScaledActor (scrolling/zooming)
+  // MoveActor (scrolling)
   constraint = Constraint::New<Vector3>( Actor::POSITION,
                                          Source( self, mPropertyPosition ),
   constraint = Constraint::New<Vector3>( Actor::POSITION,
                                          Source( self, mPropertyPosition ),
-                                         Source( self, mPropertyScale ),
-                                         MoveScaledActorConstraint );
-  constraint.SetRemoveAction(Constraint::Discard);
-  ApplyConstraintToBoundActors(constraint);
-
-  // ScaleActor (scrolling/zooming)
-  constraint = Constraint::New<Vector3>( Actor::SCALE,
-                                         Source( self, mPropertyScale ),
-                                         ScaleActorConstraint );
+                                         MoveActorConstraint );
   constraint.SetRemoveAction(Constraint::Discard);
   ApplyConstraintToBoundActors(constraint);
 
   constraint.SetRemoveAction(Constraint::Discard);
   ApplyConstraintToBoundActors(constraint);
 
index 77613e5..48b21f1 100644 (file)
@@ -36,19 +36,6 @@ Vector3 MoveActorConstraint(const Vector3&    current,
   return current + scrollPositionProperty.GetVector3();
 }
 
   return current + scrollPositionProperty.GetVector3();
 }
 
-Vector3 MoveScaledActorConstraint(const Vector3&    current,
-                                  const PropertyInput& scrollPositionProperty,
-                                  const PropertyInput& scrollScaleProperty)
-{
-  return scrollScaleProperty.GetVector3() * (current + scrollPositionProperty.GetVector3());
-}
-
-Vector3 ScaleActorConstraint(const Vector3&    current,
-                             const PropertyInput& scrollScaleProperty)
-{
- return current * scrollScaleProperty.GetVector3();
-}
-
 Vector3 WrapActorConstraint(const Vector3&    current,
                             const PropertyInput& actorScaleProperty,
                             const PropertyInput& actorAnchorPointProperty,
 Vector3 WrapActorConstraint(const Vector3&    current,
                             const PropertyInput& actorScaleProperty,
                             const PropertyInput& actorAnchorPointProperty,
index 56b6e99..1d891e9 100644 (file)
@@ -48,23 +48,6 @@ Vector3 MoveActorConstraint(const Vector3&    current,
                             const PropertyInput& scrollPositionProperty);
 
 /**
                             const PropertyInput& scrollPositionProperty);
 
 /**
- * Move-Scaled Actor constraint.
- *
- * Moves an Actor in accordance to scroll position (and scroll scale).
- */
-Vector3 MoveScaledActorConstraint(const Vector3&    current,
-                                  const PropertyInput& scrollPositionProperty,
-                                  const PropertyInput& scrollScaleProperty);
-
-/**
- * Scale Actor constraint.
- *
- * Scales an Actor in accordance to scroll scale.
- */
-Vector3 ScaleActorConstraint(const Vector3&    current,
-                             const PropertyInput& scrollScaleProperty);
-
-/**
  * Wrap Actor constraint.
  *
  * Wraps an Actors position in accordance to min/max bounds of domain.
  * Wrap Actor constraint.
  *
  * Wraps an Actors position in accordance to min/max bounds of domain.