コード例 #1
0
void RootFrameViewport::setScrollOffset(const ScrollOffset& offset,
                                        ScrollType scrollType,
                                        ScrollBehavior scrollBehavior) {
  updateScrollAnimator();

  if (scrollBehavior == ScrollBehaviorAuto)
    scrollBehavior = scrollBehaviorStyle();

  if (scrollType == ProgrammaticScroll &&
      !layoutViewport().isProgrammaticallyScrollable())
    return;

  if (scrollType == AnchoringScroll) {
    distributeScrollBetweenViewports(offset, scrollType, scrollBehavior,
                                     LayoutViewport);
    return;
  }

  if (scrollBehavior == ScrollBehaviorSmooth) {
    distributeScrollBetweenViewports(offset, scrollType, scrollBehavior,
                                     VisualViewport);
    return;
  }

  ScrollOffset clampedOffset = clampScrollOffset(offset);
  ScrollableArea::setScrollOffset(clampedOffset, scrollType, scrollBehavior);
}
コード例 #2
0
void RootFrameViewport::setScrollPosition(const DoublePoint& position, ScrollType scrollType, ScrollBehavior scrollBehavior)
{
    updateScrollAnimator();

    if (scrollBehavior == ScrollBehaviorAuto)
        scrollBehavior = scrollBehaviorStyle();

    if (scrollType == ProgrammaticScroll && !layoutViewport().isProgrammaticallyScrollable())
        return;

    if (scrollBehavior == ScrollBehaviorSmooth) {
        distributeScrollBetweenViewports(position, scrollType, scrollBehavior);
        return;
    }

    DoublePoint clampedPosition = clampScrollPosition(position);
    ScrollableArea::setScrollPosition(clampedPosition, scrollType, scrollBehavior);
}
コード例 #3
0
void RootFrameViewport::updateScrollOffset(const ScrollOffset& offset,
                                           ScrollType scrollType) {
  distributeScrollBetweenViewports(offset, scrollType, ScrollBehaviorInstant,
                                   VisualViewport);
}
コード例 #4
0
void RootFrameViewport::setScrollOffset(const DoublePoint& offset, ScrollType scrollType)
{
    distributeScrollBetweenViewports(DoublePoint(offset), scrollType, ScrollBehaviorInstant);
}