[dali_2.3.28] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / event / events / long-press-gesture / long-press-gesture-processor.cpp
index a2cc919..19b772d 100644 (file)
@@ -124,7 +124,7 @@ LongPressGestureProcessor::LongPressGestureProcessor()
 
 LongPressGestureProcessor::~LongPressGestureProcessor() = default;
 
-void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEvent& longPressEvent, Actor* actor)
+void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEvent& longPressEvent)
 {
   DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_LONG_PRESS_GESTURE");
   switch(longPressEvent.state)
@@ -135,9 +135,9 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
       ResetActor();
 
       HitTestAlgorithm::Results hitTestResults;
-      if(actor)
+      if(GetFeededActor())
       {
-        SetActor(actor);
+        SetActor(GetFeededActor());
       }
       else if(HitTest(scene, longPressEvent.point, hitTestResults))
       {
@@ -148,17 +148,18 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
 
     case GestureState::STARTED:
     {
-      Actor* currentGesturedActor = GetCurrentGesturedActor();
-      if(currentGesturedActor)
+      if(GetCurrentGesturedActor())
       {
         HitTestAlgorithm::Results hitTestResults;
-        if(actor)
+        Actor* feededActor = GetFeededActor();
+        if(feededActor)
         {
-          hitTestResults.actor = Dali::Actor(actor);
-          hitTestResults.renderTask = longPressEvent.renderTask;
+          SetActor(feededActor);
+          hitTestResults.actor = Dali::Actor(feededActor);
+          hitTestResults.renderTask = GetFeededRenderTask();
 
           Vector2     actorCoords;
-          currentGesturedActor->ScreenToLocal(*hitTestResults.renderTask.Get(), actorCoords.x, actorCoords.y, longPressEvent.point.x, longPressEvent.point.y);
+          feededActor->ScreenToLocal(*hitTestResults.renderTask.Get(), actorCoords.x, actorCoords.y, longPressEvent.point.x, longPressEvent.point.y);
           hitTestResults.actorCoordinates = actorCoords;
         }
         else
@@ -166,16 +167,16 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
           HitTest(scene, longPressEvent.point, hitTestResults);
         }
 
-        if(hitTestResults.actor && (currentGesturedActor == &GetImplementation(hitTestResults.actor)))
+        if(hitTestResults.actor && (GetCurrentGesturedActor() == &GetImplementation(hitTestResults.actor)))
         {
           // Record the current render-task for Screen->Actor coordinate conversions
           mCurrentRenderTask = hitTestResults.renderTask;
 
           // Set mCurrentLongPressEvent to use inside overridden methods called from ProcessAndEmit()
           mCurrentLongPressEvent = &longPressEvent;
-          if(actor)
+          if(feededActor)
           {
-            ProcessAndEmitActor(hitTestResults);
+            ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector());
           }
           else
           {
@@ -199,7 +200,6 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
 
       // Only send subsequent long press gesture signals if we processed the gesture when it started.
       // Check if actor is still touchable.
-
       Actor* currentGesturedActor = GetCurrentGesturedActor();
       if(currentGesturedActor)
       {