FloatPoint PinchViewport::clampOffsetToBoundaries(const FloatPoint& offset) { FloatPoint clampedOffset(offset); clampedOffset = clampedOffset.shrunkTo(FloatPoint(maximumScrollPosition())); clampedOffset = clampedOffset.expandedTo(FloatPoint(minimumScrollPosition())); return clampedOffset; }
void ScrollingTreeFrameScrollingNode::setScrollPosition(const FloatPoint& scrollPosition) { FloatPoint newScrollPosition = scrollPosition; newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition()); newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition()); setScrollPositionWithoutContentEdgeConstraints(newScrollPosition); }
void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosition) { FloatPoint newScrollPosition = scrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); setScrollPositionWithoutContentEdgeConstraints(newScrollPosition); }
IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) const { return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumScrollPosition()); }
int PinchViewport::scrollSize(ScrollbarOrientation orientation) const { IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition(); return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scrollDimensions.height(); }
bool ScrollableArea::scrolledToLeft() const { return scrollPosition().x() <= minimumScrollPosition().x(); }
bool ScrollableArea::scrolledToTop() const { return scrollPosition().y() <= minimumScrollPosition().y(); }
int RenderLayerScrollableArea::scrollSize(ScrollbarOrientation orientation) const { IntSize scrollDimensions = maximumScrollPosition() - minimumScrollPosition(); return (orientation == HorizontalScrollbar) ? scrollDimensions.width() : scrollDimensions.height(); }