bool ScrollView::startBounceBackIfNeeded()
{
    if (!_bounceEnabled)
    {
        return false;
    }
    Vec2 bounceBackAmount = getHowMuchOutOfBoundary();
    if(fltEqualZero(bounceBackAmount))
    {
        return false;
    }

    startAutoScroll(bounceBackAmount, BOUNCE_BACK_DURATION, true);
    return true;
}
Beispiel #2
0
bool ScrollView::startBounceBackIfNeeded()
{
    if (!_bounceEnabled)
    {
        return false;
    }
    Vec2 outOfBoundary = getHowMuchOutOfBoundary(Vec2::ZERO);
    if(outOfBoundary == Vec2::ZERO)
    {
        return false;
    }

    _bouncingBack = true;
    startAutoScroll(outOfBoundary, BOUNCE_BACK_DURATION, true);
    return true;
}
void ScrollView::startAttenuatingAutoScroll(const Vec2& deltaMove, const Vec2& initialVelocity)
{
    float time = calculateAutoScrollTimeByInitialSpeed(initialVelocity.length());
    startAutoScroll(deltaMove, time, true);
}
void ScrollView::startAutoScrollToDestination(const Vec2& destination, float timeInSec, bool attenuated)
{
    startAutoScroll(destination - _innerContainer->getPosition(), timeInSec, attenuated);
}
Beispiel #5
0
 inline void tst_startAutoScroll()
     { startAutoScroll(); }
Beispiel #6
0
void ScrollView::startAutoScrollChildrenWithDestination(const Vec2& des, float second, bool attenuated)
{
    startAutoScroll(des - _innerContainer->getPosition(), second, attenuated);
}
void RosegardenScrollView::startAutoScroll(int directionConstraint)
{
    setScrollDirectionConstraint(directionConstraint);
    startAutoScroll();
}