// So we know if we are at depth 4 and the stackDepth is 5, that we have gone up.
// If the depth is the same then we are effectively part of a different sub-tree from the parent, we must also remove the current clip.
// Note: Stack depth must always be at least 1, as we will have the layer or stage size as the root value.
- if( ( childStackDepth > 0u ) && ( scissorDepth <= childStackDepth ) )
+ if( ( childStackDepth > 0u ) && ( scissorDepth < childStackDepth ) )
{
- while( scissorDepth <= childStackDepth ) // Pop until sibling
+ while( scissorDepth < childStackDepth )
{
mScissorStack.pop_back();
--childStackDepth;
// We traversed up the tree, we need to apply a new scissor rectangle (unless we are at the root).
traversedUpTree = true;
}
- else if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area
+ if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area
{
mScissorStack.pop_back();
--childStackDepth;