- Actor scrollableActor = scrollable.Self();
- int overshootXPropertyIndex = scrollableActor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
- int overshootYPropertyIndex = scrollableActor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( scrollableActor, overshootXPropertyIndex ),
- Source( scrollableActor, overshootYPropertyIndex ),
- Source( scrollableActor, Actor::SIZE ),
- boost::bind( &ScrollOvershootEffectGradient::SizeConstraint, this, _1, _2, _3, _4) );
- mSizeConstraint = mOvershootImage.ApplyConstraint(constraint);
-
- constraint = Constraint::New<Quaternion>( Actor::ROTATION,
- Source( scrollableActor, overshootXPropertyIndex ),
- Source( scrollableActor, overshootYPropertyIndex ),
- boost::bind( &ScrollOvershootEffectGradient::RotationConstraint, this, _1, _2, _3) );
- mRotationConstraint = mOvershootImage.ApplyConstraint(constraint);
-
- constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( scrollableActor, Actor::SIZE ),
- Source( scrollableActor, overshootXPropertyIndex ),
- Source( scrollableActor, overshootYPropertyIndex ),
- boost::bind( &ScrollOvershootEffectGradient::PositionConstraint, this, _1, _2, _3, _4) );
- mPositionConstraint = mOvershootImage.ApplyConstraint(constraint);
-
- constraint = Constraint::New<bool>( Actor::VISIBLE,
- Source( scrollableActor, IsVertical() ? scrollableActor.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL) : scrollableActor.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL)),
- boost::bind( &ScrollOvershootEffectGradient::VisibilityConstraint, this, _1, _2) );
- mVisibilityConstraint = mOvershootImage.ApplyConstraint(constraint);
- scrollable.AddOverlay(mOvershootImage);
- SetPropertyNotifications(scrollableActor);
-}