| 150 | } |
| 151 | |
| 152 | void ScrollView::onSizeChanged() |
| 153 | { |
| 154 | Layout::onSizeChanged(); |
| 155 | _topBoundary = _contentSize.height; |
| 156 | _rightBoundary = _contentSize.width; |
| 157 | Vec2 innerSize = _innerContainer->getContentSize(); |
| 158 | float orginInnerSizeWidth = innerSize.width; |
| 159 | float orginInnerSizeHeight = innerSize.height; |
| 160 | float innerSizeWidth = MAX(orginInnerSizeWidth, _contentSize.width); |
| 161 | float innerSizeHeight = MAX(orginInnerSizeHeight, _contentSize.height); |
| 162 | _innerContainer->setContentSize(Vec2(innerSizeWidth, innerSizeHeight)); |
| 163 | setInnerContainerPosition(Vec2(0.0f, _contentSize.height - _innerContainer->getContentSize().height)); |
| 164 | |
| 165 | if (_verticalScrollBar != nullptr) |
| 166 | { |
| 167 | _verticalScrollBar->onScrolled(getHowMuchOutOfBoundary()); |
| 168 | } |
| 169 | if (_horizontalScrollBar != nullptr) |
| 170 | { |
| 171 | _horizontalScrollBar->onScrolled(getHowMuchOutOfBoundary()); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | void ScrollView::setInnerContainerSize(const Vec2& size) |
| 176 | { |
nothing calls this directly
no test coverage detected