mirror of https://github.com/axmolengine/axmol.git
Fix pageview iterator invalidation (#18091)
* allow setting and getting of pageview indicator opacity. fix some documentation comments * don't draw the indicator the selected indicator is currently overlapping * add a tweaked opacity to one of the test cases * remove unused variable * convert tabs to whitespace * change constexpr to static const * fix iterator invalidation when adding or removing pages from the pageview
This commit is contained in:
parent
b77c29f750
commit
12fc75790b
|
@ -215,6 +215,10 @@ void PageViewIndicator::setIndexNodesTexture(const std::string& texName, Widget:
|
|||
|
||||
void PageViewIndicator::increaseNumberOfPages()
|
||||
{
|
||||
if ( _currentOverlappingIndexNode ) {
|
||||
_currentOverlappingIndexNode->setVisible(true);
|
||||
_currentOverlappingIndexNode = nullptr;
|
||||
}
|
||||
Sprite* indexNode;
|
||||
|
||||
if(_useDefaultTexture)
|
||||
|
@ -245,6 +249,10 @@ void PageViewIndicator::increaseNumberOfPages()
|
|||
|
||||
void PageViewIndicator::decreaseNumberOfPages()
|
||||
{
|
||||
if ( _currentOverlappingIndexNode ) {
|
||||
_currentOverlappingIndexNode->setVisible(true);
|
||||
_currentOverlappingIndexNode = nullptr;
|
||||
}
|
||||
if(_indexNodes.empty())
|
||||
{
|
||||
return;
|
||||
|
@ -255,6 +263,10 @@ void PageViewIndicator::decreaseNumberOfPages()
|
|||
|
||||
void PageViewIndicator::clear()
|
||||
{
|
||||
if ( _currentOverlappingIndexNode ) {
|
||||
_currentOverlappingIndexNode->setVisible(true);
|
||||
_currentOverlappingIndexNode = nullptr;
|
||||
}
|
||||
for(auto& indexNode : _indexNodes)
|
||||
{
|
||||
removeProtectedChild(indexNode);
|
||||
|
|
Loading…
Reference in New Issue