| 2302 | case SimplifiedScrollDirectionBottomToTop: |
| 2303 | directionDependentContentDisplacement.y = -std::min(frame.height, canScrollDistance); |
| 2304 | break; |
| 2305 | case SimplifiedScrollDirectionLeftToRight: |
| 2306 | directionDependentContentDisplacement.x = std::min(frame.width, canScrollDistance); |
| 2307 | break; |
| 2308 | case SimplifiedScrollDirectionRightToLeft: |
| 2309 | directionDependentContentDisplacement.x = -std::min(frame.width, canScrollDistance); |
| 2310 | break; |
| 2311 | } |
| 2312 | |
| 2313 | auto directionDependentContentOffset = _scrollState->getDirectionDependentContentOffset(); |
| 2314 | directionDependentContentOffset += directionDependentContentDisplacement; |
| 2315 | |
| 2316 | auto directionAgnosticContentOffset = |
| 2317 | _scrollState->resolveDirectionAgnosticContentOffset(directionDependentContentOffset); |
| 2318 | setScrollContentOffset(viewTransactionScope, directionAgnosticContentOffset, animated); |
| 2319 | |
| 2320 | if (outScrollPageCurrent != nullptr) { |
| 2321 | *outScrollPageCurrent = getPageNumberForContentOffset(directionAgnosticContentOffset); |
| 2322 | } |
| 2323 | if (outScrollPageMaximum != nullptr) { |
| 2324 | auto contentSize = _scrollState->getContentSize(); |
| 2325 | auto directionAgnosticContentMaximum = |
| 2326 | Point(contentSize.width - frame.width, contentSize.height - frame.height); |
| 2327 | *outScrollPageMaximum = getPageNumberForContentOffset(directionAgnosticContentMaximum); |
| 2328 | } |
| 2329 | |
| 2330 | return true; |
| 2331 | } |
| 2332 | |
| 2333 | if (hasParent()) { |
| 2334 | return getParent()->scrollByOnePage( |
no test coverage detected