From 8c2b4c78dbae7d9263f55f22d650d4818a91ea4e Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 10 Dec 2015 13:37:07 +0800 Subject: [PATCH] fix scrollview render error --- cocos/ui/UIScrollView.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index 81ae8b64a6..e4e5f0cf02 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -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; }