Using New Constraints
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / shader-effects / motion-stretch-effect.cpp
index 48dff1d..8817171 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/public-api/shader-effects/motion-stretch-effect.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 
 namespace Dali
@@ -98,14 +99,13 @@ MotionStretchEffect MotionStretchEffect::Apply( RenderableActor renderable )
   MotionStretchEffect newEffect = New();
   renderable.SetShaderEffect( newEffect );
 
-  Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_STRETCH_MODELVIEW_LASTFRAME );
+  Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_STRETCH_MODELVIEW_LASTFRAME );
 
-  Constraint constraint = Constraint::New<Matrix>( uModelProperty,
-                                                   Source( renderable, Actor::WORLD_MATRIX ),
-                                                   EqualToConstraint() );
+  Constraint constraint = Constraint::New<Matrix>( newEffect, uModelProperty, EqualToConstraint() );
+  constraint.AddSource( Source( renderable, Actor::Property::WORLD_MATRIX ) );
 
   // and set up constraint.
-  newEffect.ApplyConstraint(constraint);
+  constraint.Apply();
   return newEffect;
 }