Fix scissor clipping
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-algorithms.cpp
index 94658ea..664eb6b 100644 (file)
@@ -244,9 +244,9 @@ inline void RenderAlgorithms::SetupScissorClipping( const RenderItem& item, Cont
   // 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;
@@ -255,7 +255,7 @@ inline void RenderAlgorithms::SetupScissorClipping( const RenderItem& item, Cont
     // 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;