Touch and Hover event propagrated by geometry way.(5)
[platform/core/uifw/dali-core.git] / dali / internal / event / events / tap-gesture / tap-gesture-processor.cpp
index bb4cfa7..89c34d5 100644 (file)
@@ -109,7 +109,15 @@ void TapGestureProcessor::Process(Scene& scene, const TapGestureEvent& tapEvent)
     {
       // Do a hit test and if an actor has been hit then save to see if tap event is still valid on a tap( same actor being hit )
       HitTestAlgorithm::Results hitTestResults;
-      if(HitTest(scene, tapEvent.point, hitTestResults))
+      if(GetFeededActor())
+      {
+        SetActor(GetFeededActor());
+        mCurrentTapActor.SetActor(GetCurrentGesturedActor());
+
+        // Indicate that we've processed a touch down. Bool should be sufficient as a change in actor will result in a cancellation
+        mPossibleProcessed = true;
+      }
+      else if(HitTest(scene, tapEvent.point, hitTestResults))
       {
         SetActor(&GetImplementation(hitTestResults.actor));
         mCurrentTapActor.SetActor(GetCurrentGesturedActor());
@@ -128,16 +136,32 @@ void TapGestureProcessor::Process(Scene& scene, const TapGestureEvent& tapEvent)
     {
       // Ensure that we're processing a hit on the current actor and that we've already processed a touch down
       HitTestAlgorithm::Results hitTestResults;
-      if(GetCurrentGesturedActor() && HitTest(scene, tapEvent.point, hitTestResults) && mPossibleProcessed)
+      if(GetCurrentGesturedActor())
       {
-        // Check that this actor is still the one that was used for the last touch down ?
-        if(mCurrentTapActor.GetActor() == &GetImplementation(hitTestResults.actor))
+        if(GetFeededActor())
+        {
+          hitTestResults.actor = Dali::Actor(GetFeededActor());
+          hitTestResults.renderTask = GetFeededRenderTask();
+          // Check that this actor is still the one that was used for the last touch down ?
+          if(mCurrentTapActor.GetActor() == &GetImplementation(hitTestResults.actor))
+          {
+            mCurrentTapEvent = &tapEvent;
+            ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector());
+          }
+          mCurrentTapEvent   = nullptr;
+          mPossibleProcessed = false;
+        }
+        else if(HitTest(scene, tapEvent.point, hitTestResults) && mPossibleProcessed)
         {
-          mCurrentTapEvent = &tapEvent;
-          ProcessAndEmit(hitTestResults);
+          // Check that this actor is still the one that was used for the last touch down ?
+          if(mCurrentTapActor.GetActor() == &GetImplementation(hitTestResults.actor))
+          {
+            mCurrentTapEvent = &tapEvent;
+            ProcessAndEmit(hitTestResults);
+          }
+          mCurrentTapEvent   = nullptr;
+          mPossibleProcessed = false;
         }
-        mCurrentTapEvent   = nullptr;
-        mPossibleProcessed = false;
       }
       break;
     }