We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果scrollview在moving的过程中visible从true变为false, 会导致onTouchEnded和onTouchCanceled不能正确结束,_touchMoved一直为true。触摸就被锁死了。附上简单的代码。 `
bool ScrollView::onTouchBegan(Touch* touch, Event* event) { if (_touches.size() > 2 || _touchMoved || !frame.containsPoint(touch->getLocation())) { return false; } } void ScrollView::onTouchMoved(Touch* touch, Event* event) { _touchMoved = true; } void ScrollView::onTouchEnded(Touch* touch, Event* event) { if (!this->isVisible()) { return; //----------->在这返回了 } auto touchIter = std::find(_touches.begin(), _touches.end(), touch); if (touchIter != _touches.end()) { if (_touches.size() == 1 && _touchMoved) { this->schedule(CC_SCHEDULE_SELECTOR(ScrollView::deaccelerateScrolling)); } _touches.erase(touchIter); } if (_touches.size() == 0) { _dragging = false; _touchMoved = false; } } void ScrollView::onTouchCancelled(Touch* touch, Event* event) { if (!this->isVisible()) { return; //----------->在这返回了 } auto touchIter = std::find(_touches.begin(), _touches.end(), touch); _touches.erase(touchIter); if (_touches.size() == 0) { _dragging = false; _touchMoved = false; } }
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果scrollview在moving的过程中visible从true变为false, 会导致onTouchEnded和onTouchCanceled不能正确结束,_touchMoved一直为true。触摸就被锁死了。附上简单的代码。
`
`
The text was updated successfully, but these errors were encountered: