void CCLayerImpl::scrollBy(const FloatSize& scroll) { FloatSize newDelta = m_scrollDelta + scroll; IntSize minDelta = -toSize(m_scrollPosition); IntSize maxDelta = m_maxScrollPosition - toSize(m_scrollPosition); // Clamp newDelta so that position + delta stays within scroll bounds. m_scrollDelta = newDelta.expandedTo(minDelta).shrunkTo(maxDelta); noteLayerPropertyChangedForSubtree(); }