void ScrollableArea::programmaticScrollHelper(const DoublePoint& position, ScrollBehavior scrollBehavior)
{
    cancelScrollAnimation();

    if (scrollBehavior == ScrollBehaviorSmooth)
        programmaticScrollAnimator()->animateToOffset(toFloatPoint(position));
    else
        programmaticScrollAnimator()->scrollToOffsetWithoutAnimation(toFloatPoint(position));
}
示例#2
0
void ScrollableArea::programmaticallyScrollSmoothlyToOffset(const FloatPoint& offset)
{
    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
        scrollAnimator->cancelAnimations();
    programmaticScrollAnimator()->animateToOffset(offset);
}