- Property::Index scrollSpeedProperty = itemView.GetPropertyIndex("item-view-scroll-speed");
- Property::Index scrollPositionProperty = scrollPositionObject.GetPropertyIndex("scroll-position");
-
- // We want to animate the layout in so use a weight object to do this
- if ( !mWeightObject )
- {
- mWeightObject = WeightObject::New();
- }
-
- ItemLayout::Vector3Function positionConstraint;
- if (GetPositionConstraint(itemId, positionConstraint))
- {
- WrappedVector3Constraint wrapped(positionConstraint, itemId);
- Constraint constraint = Constraint::New<Vector3>( actor, Actor::Property::POSITION, wrapped );
- constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
- constraint.AddSource( ParentSource( scrollSpeedProperty ) );
- constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
- constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
- constraint.Apply();
- }
-
- ItemLayout::QuaternionFunction rotationConstraint;
- if (GetRotationConstraint(itemId, rotationConstraint))
- {
- WrappedQuaternionConstraint wrapped(rotationConstraint, itemId);
-
- Constraint constraint = Constraint::New<Quaternion>( actor, Actor::Property::ORIENTATION, wrapped );
- constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
- constraint.AddSource( ParentSource( scrollSpeedProperty ) );
- constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
- constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
- constraint.Apply();
- }