Merge pull request #12736 from marzapower/patch-1

Fixed inertial scrolling for `CCScrollView`
This commit is contained in:
子龙山人 2015-07-13 22:14:58 +08:00
commit 2c40c762e4
1 changed files with 2 additions and 2 deletions

View File

@ -436,8 +436,8 @@ void ScrollView::deaccelerateScrolling(float dt)
if ((fabsf(_scrollDistance.x) <= SCROLL_DEACCEL_DIST &&
fabsf(_scrollDistance.y) <= SCROLL_DEACCEL_DIST) ||
newY >= maxInset.y || newY <= minInset.y ||
newX >= maxInset.x || newX <= minInset.x)
((_direction == Direction::BOTH || _direction == Direction::VERTICAL) && (newY >= maxInset.y || newY <= minInset.y)) ||
((_direction == Direction::BOTH || _direction == Direction::HORIZONTAL) && (newX >= maxInset.x || newX <= minInset.x)))
{
this->unschedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling));
this->relocateContainer(true);