- mEffectX->Reset();
- mEffectY->Reset();
-}
-
-ScrollOvershootEffect::ScrollOvershootEffect(bool vertical) :
- mVertical(vertical)
-{
-
-}
-
-ScrollOvershootEffectGradient::ScrollOvershootEffectGradient(bool vertical) :
- ScrollOvershootEffect(vertical),
- mMaxOvershootImageSize(DEFAULT_MAX_OVERSHOOT_HEIGHT)
-{
- Image overshootImage = Image::New( OVERSHOOT_OVERLAY_IMAGE_PATH );
- mOvershootImage = ImageActor::New( overshootImage );
- mOvershootImage.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mOvershootImage.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- mOvershootImage.SetDrawMode(DrawMode::OVERLAY);
-}
-
-void ScrollOvershootEffectGradient::Apply(Scrollable& scrollable)
-{
- 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);
-}
-
-void ScrollOvershootEffectGradient::Remove(Scrollable& scrollable)
-{
- if(mOvershootImage)