add isVisibleByVisitingCamera check when visit

This commit is contained in:
yangxiao 2014-10-17 18:07:45 +08:00
parent 4991b2308d
commit 66dd0807eb
3 changed files with 3 additions and 3 deletions

View File

@ -271,7 +271,7 @@ void ProtectedNode::reorderProtectedChild(cocos2d::Node *child, int localZOrder)
void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags) void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{ {
// quick return if not visible. children won't be drawn. // quick return if not visible. children won't be drawn.
if (!_visible) if (!_visible || !isVisitableByVisitingCamera())
{ {
return; return;
} }

View File

@ -236,7 +236,7 @@ void Widget::onExit()
void Widget::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) void Widget::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{ {
if (_visible) if (_visible || !isVisitableByVisitingCamera())
{ {
adaptRenderers(); adaptRenderers();
ProtectedNode::visit(renderer, parentTransform, parentFlags); ProtectedNode::visit(renderer, parentTransform, parentFlags);

View File

@ -579,7 +579,7 @@ void ScrollView::onAfterDraw()
void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{ {
// quick return if not visible // quick return if not visible
if (!isVisible()) if (!isVisible() || !isVisitableByVisitingCamera())
{ {
return; return;
} }