[dali_2.3.42] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / event / events / long-press-gesture / long-press-gesture-processor.cpp
index 81cead4..32535ec 100644 (file)
@@ -135,11 +135,7 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
       ResetActor();
 
       HitTestAlgorithm::Results hitTestResults;
-      if(GetFeededActor())
-      {
-        SetActor(GetFeededActor());
-      }
-      else if(HitTest(scene, longPressEvent.point, hitTestResults))
+      if(HitTest(scene, longPressEvent.point, hitTestResults))
       {
         SetActor(&GetImplementation(hitTestResults.actor));
       }
@@ -152,19 +148,7 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
       if(currentGesturedActor)
       {
         HitTestAlgorithm::Results hitTestResults;
-        if(GetFeededActor())
-        {
-          hitTestResults.actor = Dali::Actor(GetFeededActor());
-          hitTestResults.renderTask = GetFeededRenderTask();
-
-          Vector2     actorCoords;
-          currentGesturedActor->ScreenToLocal(*hitTestResults.renderTask.Get(), actorCoords.x, actorCoords.y, longPressEvent.point.x, longPressEvent.point.y);
-          hitTestResults.actorCoordinates = actorCoords;
-        }
-        else
-        {
-          HitTest(scene, longPressEvent.point, hitTestResults);
-        }
+        HitTest(scene, longPressEvent.point, hitTestResults);
 
         if(hitTestResults.actor && (currentGesturedActor == &GetImplementation(hitTestResults.actor)))
         {
@@ -173,14 +157,7 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
 
           // Set mCurrentLongPressEvent to use inside overridden methods called from ProcessAndEmit()
           mCurrentLongPressEvent = &longPressEvent;
-          if(GetFeededActor())
-          {
-            ProcessAndEmitActor(hitTestResults, GetFeededGestureDetector());
-          }
-          else
-          {
-            ProcessAndEmit(hitTestResults);
-          }
+          ProcessAndEmit(hitTestResults);
           mCurrentLongPressEvent = nullptr;
         }
         else
@@ -199,6 +176,7 @@ 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)
       {
@@ -207,10 +185,7 @@ void LongPressGestureProcessor::Process(Scene& scene, const LongPressGestureEven
           // Ensure actor is still attached to the emitters, if it is not then remove the emitter.
           GestureDetectorContainer::iterator endIter = std::remove_if(mCurrentEmitters.begin(), mCurrentEmitters.end(), IsNotAttachedFunctor(currentGesturedActor));
           mCurrentEmitters.erase(endIter, mCurrentEmitters.end());
-          if(GetFeededGestureDetector())
-          {
-            mCurrentEmitters.push_back(GetFeededGestureDetector());
-          }
+
           if(!mCurrentEmitters.empty())
           {
             Vector2     actorCoords;
@@ -369,11 +344,12 @@ void LongPressGestureProcessor::OnGesturedActorStageDisconnection()
 bool LongPressGestureProcessor::CheckGestureDetector(GestureDetector* detector, Actor* actor)
 {
   DALI_ASSERT_DEBUG(mCurrentLongPressEvent);
-
-  LongPressGestureDetector* longPressDetector(static_cast<LongPressGestureDetector*>(detector));
-
-  return (longPressDetector->GetMinimumTouchesRequired() <= mCurrentLongPressEvent->numberOfTouches) &&
-         (longPressDetector->GetMaximumTouchesRequired() >= mCurrentLongPressEvent->numberOfTouches);
+  bool ret = false;
+  if(detector)
+  {
+    ret = detector->CheckGestureDetector(mCurrentLongPressEvent, actor, mCurrentRenderTask);
+  }
+  return ret;
 }
 
 void LongPressGestureProcessor::EmitGestureSignal(Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates)