X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fbouncing-effect-actor.cpp;h=5ea57534cd053e87cad855bf3509cb0eadfe3ae8;hb=66c5b1e0a29cc284f7acbe3f1e0e6bd8ee43316e;hp=86ade19428c2fffe527aba5cda2e87819417afe8;hpb=b8d4bac83c801b93dc7b3298148864a4215e139f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index 86ade19..5ea5753 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include @@ -58,10 +57,9 @@ struct VertexPositionConstraint { } - Vector3 operator()( const Vector3& current, const PropertyInput& bounceCoef ) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - float positionY = mInitialY + mRange * fabsf(bounceCoef.GetFloat()); - return Vector3( current.x, positionY, current.z ); + current.y = mInitialY + mRange * fabsf( inputs[0]->GetFloat() ); } float mInitialY; @@ -107,12 +105,13 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) for( size_t i=0;i( mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::POSITION ), - Source(meshActor, bouncePropertyIndex), - VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) ); - mesh.ApplyConstraint( Constraint::New( mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION), - Source(meshActor, bouncePropertyIndex), - VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ) ); + Constraint constraint = Constraint::New( mesh, mesh.GetPropertyIndex(j+2, AnimatableVertex::Property::POSITION ), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ); + constraint.AddSource( Source(meshActor, bouncePropertyIndex) ); + constraint.Apply(); + + constraint = Constraint::New( mesh, mesh.GetPropertyIndex(j+3, AnimatableVertex::Property::POSITION), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) ); + constraint.AddSource( Source(meshActor, bouncePropertyIndex) ); + constraint.Apply(); } return meshActor;