fix notification crashing when shown during a transition fade

This commit is contained in:
Cvolton 2024-06-13 01:30:38 +02:00
parent eb7c4d9803
commit 0270d472a9
No known key found for this signature in database

View file

@ -172,7 +172,7 @@ void Notification::show() {
if (!this->getParent()) {
auto winSize = CCDirector::get()->getWinSize();
this->setPosition(winSize.width / 2, winSize.height / 4);
this->setZOrder(CCScene::get()->getHighestChildZ() + 100);
this->setZOrder(CCScene::get()->getChildrenCount() > 0 ? CCScene::get()->getHighestChildZ() + 100 : 100);
}
SceneManager::get()->keepAcrossScenes(this);
m_showing = true;