mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12736 from marzapower/patch-1
Fixed inertial scrolling for `CCScrollView`
This commit is contained in:
commit
2c40c762e4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue