From: Adeel Kazmi Date: Fri, 27 Jun 2014 09:23:02 +0000 (+0900) Subject: (ScrollView) Removed unnecessary scale constraints from scroll-view X-Git-Tag: dali_1.0.0~14 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=a81e6cdec136b728115431822a2ff3f60e279045;hp=6af5947bc891acb3ee308d9bca5f848fb69a1744 (ScrollView) Removed unnecessary scale constraints from scroll-view [problem] ScrollView should not scale itself or its children [solution] Remove constraints that do this Change-Id: I9259643006e4b2d7dc7030bbebe3856e1073a5f8 Signed-off-by: Adeel Kazmi --- 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 81c8893..b5a0751 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 @@ -2863,27 +2863,15 @@ void ScrollView::SetInternalConstraints() // 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 - // TODO: Look into removing some of these constraints Constraint constraint; - // MoveScaledActor (scrolling/zooming) + // MoveActor (scrolling) constraint = Constraint::New( Actor::POSITION, Source( self, mPropertyPosition ), - Source( self, mPropertyScale ), - MoveScaledActorConstraint ); - constraint.SetRemoveAction(Constraint::Discard); - ApplyConstraintToBoundActors(constraint); - - // ScaleActor (scrolling/zooming) - constraint = Constraint::New( Actor::SCALE, - Source( self, mPropertyScale ), - ScaleActorConstraint ); + MoveActorConstraint ); constraint.SetRemoveAction(Constraint::Discard); ApplyConstraintToBoundActors(constraint); diff --git a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp index 77613e5..48b21f1 100644 --- a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp +++ b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp @@ -36,19 +36,6 @@ Vector3 MoveActorConstraint(const Vector3& current, 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, diff --git a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h index 56b6e99..1d891e9 100644 --- a/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h +++ b/base/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h @@ -48,23 +48,6 @@ Vector3 MoveActorConstraint(const Vector3& current, 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.