| 421 | } |
| 422 | |
| 423 | Vec2 ScrollView::getHowMuchOutOfBoundary(const Vec2& addition) |
| 424 | { |
| 425 | if (addition == Vec2::ZERO && !_outOfBoundaryAmountDirty) |
| 426 | { |
| 427 | return _outOfBoundaryAmount; |
| 428 | } |
| 429 | |
| 430 | Vec2 outOfBoundaryAmount(Vec2::ZERO); |
| 431 | if (_innerContainer->getLeftBoundary() + addition.x > _leftBoundary) |
| 432 | { |
| 433 | outOfBoundaryAmount.x = _leftBoundary - (_innerContainer->getLeftBoundary() + addition.x); |
| 434 | } |
| 435 | else if (_innerContainer->getRightBoundary() + addition.x < _rightBoundary) |
| 436 | { |
| 437 | outOfBoundaryAmount.x = _rightBoundary - (_innerContainer->getRightBoundary() + addition.x); |
| 438 | } |
| 439 | |
| 440 | if (_innerContainer->getTopBoundary() + addition.y < _topBoundary) |
| 441 | { |
| 442 | outOfBoundaryAmount.y = _topBoundary - (_innerContainer->getTopBoundary() + addition.y); |
| 443 | } |
| 444 | else if (_innerContainer->getBottomBoundary() + addition.y > _bottomBoundary) |
| 445 | { |
| 446 | outOfBoundaryAmount.y = _bottomBoundary - (_innerContainer->getBottomBoundary() + addition.y); |
| 447 | } |
| 448 | |
| 449 | if (addition == Vec2::ZERO) |
| 450 | { |
| 451 | _outOfBoundaryAmount = outOfBoundaryAmount; |
| 452 | _outOfBoundaryAmountDirty = false; |
| 453 | } |
| 454 | return outOfBoundaryAmount; |
| 455 | } |
| 456 | |
| 457 | bool ScrollView::isOutOfBoundary(MoveDirection dir) |
| 458 | { |
nothing calls this directly
no test coverage detected