Hit test algorithm fixed to traverse hit actor tree if stencil first 76/24076/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 11 Jun 2014 15:11:24 +0000 (16:11 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 13:15:21 +0000 (14:15 +0100)
[problem]      If stencil is added to layer before a tree of actors only the first actor in the tree will be returned, it's children will not be traversed.
[solution]     Only stop traversal if current actor is a stencil and that stencil was hit, else traverse children.

Change-Id: I19bf8b3a24b2ac5629079bec7131b266db460143
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
dali/internal/event/events/hit-test-algorithm-impl.cpp

index f849756..49df17c 100644 (file)
@@ -183,8 +183,8 @@ HitActor HitTestWithinLayer( Actor& actor,
     }
   }
 
-  // If there is a stencil on this layer and we've also registered a hit, then don't both searching any children
-  if ( stencilHit && hit.actor )
+  // If we are a stencil (or a child of a stencil) and we have already ascertained that the stencil has been hit then there is no need to hit-test the children of this stencil-actor
+  if ( isStencil && stencilHit  )
   {
     return hit;
   }