diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 74683aa522..7cf34a2502 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -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);