diff --git a/cocos/ui/CCProtectedNode.cpp b/cocos/ui/CCProtectedNode.cpp index d8a12940ec..d86292e6f9 100644 --- a/cocos/ui/CCProtectedNode.cpp +++ b/cocos/ui/CCProtectedNode.cpp @@ -304,7 +304,7 @@ void ProtectedNode::visit(Renderer* renderer, const kmMat4 &parentTransform, boo { auto node = _children.at(i); - if ( node && node->getZOrder() < 0 ) + if ( node && node->getLocalZOrder() < 0 ) node->visit(renderer, _modelViewTransform, dirty); else break; @@ -314,7 +314,7 @@ void ProtectedNode::visit(Renderer* renderer, const kmMat4 &parentTransform, boo { auto node = _protectedChildren.at(j); - if ( node && node->getZOrder() < 0 ) + if ( node && node->getLocalZOrder() < 0 ) node->visit(renderer, _modelViewTransform, dirty); else break; diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 7399653ad4..9e4886e369 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -790,7 +790,7 @@ void Layout::stencilClippingVisit(Renderer *renderer, const kmMat4 &parentTransf { auto node = _children.at(i); - if ( node && node->getZOrder() < 0 ) + if ( node && node->getLocalZOrder() < 0 ) node->visit(renderer, _modelViewTransform, dirty); else break; @@ -800,7 +800,7 @@ void Layout::stencilClippingVisit(Renderer *renderer, const kmMat4 &parentTransf { auto node = _protectedChildren.at(j); - if ( node && node->getZOrder() < 0 ) + if ( node && node->getLocalZOrder() < 0 ) node->visit(renderer, _modelViewTransform, dirty); else break;