From ba0851e4fa15c4c073619756c79697eed4b9595a Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Sat, 11 Feb 2023 12:57:35 +0200 Subject: [PATCH] fix swapChildIndices not also swapping z order and order of arrival --- loader/src/cocos2d-ext/Layout.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/src/cocos2d-ext/Layout.cpp b/loader/src/cocos2d-ext/Layout.cpp index a91cb354..f4b8729d 100644 --- a/loader/src/cocos2d-ext/Layout.cpp +++ b/loader/src/cocos2d-ext/Layout.cpp @@ -10,6 +10,8 @@ USE_GEODE_NAMESPACE(); void CCNode::swapChildIndices(CCNode* first, CCNode* second) { m_pChildren->exchangeObject(first, second); + std::swap(first->m_nZOrder, second->m_nZOrder); + std::swap(first->m_uOrderOfArrival, second->m_uOrderOfArrival); } CCArray* Layout::getNodesToPosition(CCNode* on) {