cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.29k stars 7.05k forks source link

ui::PageViewIndicator rendering glitch #17347

Open Rubonnek opened 7 years ago

Rubonnek commented 7 years ago

Steps to Reproduce:

  1. Create a new C++ project and replace HelloWorldScene.cpp with the attached code: HelloWorldScene_cpp.txt
  2. Compile and run.
  3. Note that only two items where pushed into page_view. When both, ui::PageView::setIndicatorIndexNodesScale and ui::PageView::setIndicatorSpaceBetweenIndexNodes are called in that specific order, a third indicator will appear temporarily. Moving to the next page will make the indicator disappear. The spacing between the indicator nodes seems to be wrong too.
Rubonnek commented 7 years ago

Adding page_view->forceDoLayout(); before the return statement seems to fix the problem. Not quite sure if the third indicator that appears is considered a bug, but if it isn't please close this issue.