Skip to content

Commit

Permalink
Correct the wrong boolean statement and make it easy to read
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo Kim committed Jul 14, 2015
1 parent 863c3a0 commit 7882a53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cocos/ui/UIScrollView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,9 @@ bool ScrollView::scrollChildren(float touchOffsetX, float touchOffsetY)
processScrollEvent(MoveDirection::RIGHT, false);
}

return !scrolledToBottom && !scrolledToTop && !scrolledToLeft && !scrolledToRight;
bool scrollEnabledUpDown = (!scrolledToBottom && !scrolledToTop);
bool scrollEnabledLeftRight = (!scrolledToLeft && !scrolledToRight);
return scrollEnabledUpDown || scrollEnabledLeftRight;
}

void ScrollView::scrollToBottom(float second, bool attenuated)
Expand Down

0 comments on commit 7882a53

Please sign in to comment.