fix scrollview render error

This commit is contained in:
Liam 2015-12-10 13:37:07 +08:00
parent ea2354932c
commit 8c2b4c78db
1 changed files with 2 additions and 10 deletions

View File

@ -178,19 +178,11 @@ void ScrollView::setInnerContainerSize(const Size &size)
// Calculate and set the position of the inner container.
Vec2 pos = _innerContainer->getPosition();
if (_innerContainer->getLeftBoundary() > 0.0f)
if (_innerContainer->getLeftBoundary() != 0.0f)
{
pos.x = _innerContainer->getAnchorPoint().x * _innerContainer->getContentSize().width;
}
if (_innerContainer->getRightBoundary() < _contentSize.width)
{
pos.x = _contentSize.width - ((1.0f - _innerContainer->getAnchorPoint().x) * _innerContainer->getContentSize().width);
}
if (_innerContainer->getPosition().y > 0.0f)
{
pos.y = _innerContainer->getAnchorPoint().y * _innerContainer->getContentSize().height;
}
if (_innerContainer->getTopBoundary() < _contentSize.height)
if (_innerContainer->getTopBoundary() != _contentSize.height)
{
pos.y = _contentSize.height - (1.0f - _innerContainer->getAnchorPoint().y) * _innerContainer->getContentSize().height;
}