[Tizen] Add an environment variable for long press gesture
[platform/core/uifw/dali-core.git] / dali / internal / event / events / pan-gesture / pan-gesture-processor.cpp
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/event/events/pan-gesture/pan-gesture-processor.h>
20
21 #if defined(DEBUG_ENABLED)
22 #include <sstream>
23 #endif
24
25 // EXTERNAL INCLUDES
26 #include <algorithm>
27
28 // INTERNAL INCLUDES
29 #include <dali/public-api/actors/actor.h>
30 #include <dali/public-api/common/dali-common.h>
31 #include <dali/public-api/events/pan-gesture.h>
32 #include <dali/public-api/math/vector2.h>
33 #include <dali/internal/event/events/pan-gesture/pan-gesture-event.h>
34 #include <dali/integration-api/debug.h>
35 #include <dali/internal/event/common/scene-impl.h>
36 #include <dali/internal/event/render-tasks/render-task-impl.h>
37 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
38 #include <dali/internal/event/events/multi-point-event-util.h>
39 #include <dali/internal/event/events/pan-gesture/pan-gesture-recognizer.h>
40 #include <dali/internal/event/events/gesture-requests.h>
41
42 namespace Dali
43 {
44
45 namespace Internal
46 {
47
48 namespace // unnamed namespace
49 {
50
51 #if defined(DEBUG_ENABLED)
52 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_PAN_PROCESSOR" );
53
54 const char * GESTURE_STATES[ 6 ] =
55 {
56   "Clear",
57   "Started",
58   "Continuing",
59   "Finished",
60   "Cancelled",
61   "Possible"
62 };
63
64 #endif // defined(DEBUG_ENABLED)
65
66 const unsigned long MAXIMUM_TIME_WITH_VALID_LAST_VELOCITY( 50u );
67
68 /**
69  * Functor which checks whether the specified actor is attached to the gesture detector.
70  * If the actor is attached, it also checks whether the number of touches of the current pan event
71  * are within the range of that expected by the detector.
72  * It returns true if it is no longer attached or the touches are out of range.
73  * This can be used in remove_if functions.
74  */
75 struct IsNotAttachedAndOutsideTouchesRangeFunctor
76 {
77   /**
78    * Constructor
79    * @param[in]  actor                 The actor to check whether it is attached.
80    * @param[in]  touches               The number of touches in the current pan event.
81    * @param[in]  outsideRangeEmitters  Reference to container where emitters outside of the touches range should be added.
82    */
83   IsNotAttachedAndOutsideTouchesRangeFunctor(Actor* actor, unsigned int touches, GestureDetectorContainer& outsideRangeEmitters)
84   : actorToCheck(actor),
85     numberOfTouches(touches),
86     outsideTouchesRangeEmitters(outsideRangeEmitters)
87   {
88   }
89
90   /**
91    * Returns true if not attached, false if it is still attached.
92    * Additionally, checks if the number of touches has changed and stops sending the pan to a particular
93    * detector if it exceeds the range of that detector.
94    * @param[in]  detector  The detector to check.
95    * @return true, if not attached, false otherwise.
96    */
97   bool operator()(GestureDetector* detector) const
98   {
99     bool remove(!detector->IsAttached(*actorToCheck));
100
101     if (!remove)
102     {
103       PanGestureDetector* panDetector( static_cast< PanGestureDetector* >( detector ) );
104
105       // Ensure number of touch points is within the range of our emitter. If it isn't then remove
106       // this emitter and add it to the outsideTouchesRangeEmitters container
107       if ( (numberOfTouches < panDetector->GetMinimumTouchesRequired()) ||
108            (numberOfTouches > panDetector->GetMaximumTouchesRequired()) )
109       {
110         remove = true;
111         outsideTouchesRangeEmitters.push_back(detector);
112       }
113     }
114
115     return remove;
116   }
117
118   Actor* actorToCheck; ///< The actor to check whether it is attached or not.
119   unsigned int numberOfTouches; ///< The number of touches in the pan event.
120   GestureDetectorContainer& outsideTouchesRangeEmitters; ///< Emitters that are outside of the range of current pan.
121 };
122
123 } // unnamed namespace
124
125 PanGestureProcessor::PanGestureProcessor( SceneGraph::UpdateManager& updateManager )
126 : GestureProcessor( Gesture::Pan ),
127   mPanGestureDetectors(),
128   mCurrentPanEmitters(),
129   mCurrentRenderTask(),
130   mPossiblePanPosition(),
131   mMinTouchesRequired( 1 ),
132   mMaxTouchesRequired( 1 ),
133   mCurrentPanEvent( nullptr ),
134   mSceneObject( SceneGraph::PanGesture::New() ) // Create scene object to store pan information.
135 {
136   // Pass ownership to scene-graph; scene object lives for the lifecycle of UpdateManager
137   updateManager.SetPanGestureProcessor( mSceneObject );
138 }
139
140 PanGestureProcessor::~PanGestureProcessor()
141 {
142   mSceneObject = nullptr; // mSceneObject is owned and destroyed by update manager (there is only one of these for now)
143 }
144
145 void PanGestureProcessor::Process( Scene& scene, const PanGestureEvent& panEvent )
146 {
147 #if defined(DEBUG_ENABLED)
148   DALI_LOG_TRACE_METHOD( gLogFilter );
149
150   DALI_LOG_INFO( gLogFilter, Debug::General, "    Pan Event\n");
151   DALI_LOG_INFO( gLogFilter, Debug::General, "      State: %s  Touches: %d  Time: %d  TimeDelta: %d\n",
152                                              GESTURE_STATES[panEvent.state], panEvent.numberOfTouches, panEvent.time, panEvent.timeDelta);
153   DALI_LOG_INFO( gLogFilter, Debug::General, "      Positions: Current: (%.0f, %.0f), Previous: (%.0f, %.0f)\n",
154                                              panEvent.currentPosition.x, panEvent.currentPosition.y, panEvent.previousPosition.x, panEvent.previousPosition.y);
155 #endif
156
157   switch( panEvent.state )
158   {
159     case Gesture::Possible:
160     {
161       mCurrentPanEmitters.clear();
162       ResetActor();
163
164       // It's only possible on touch-down, which is the position we want to hit-test against when the pan actually starts
165       mPossiblePanPosition = panEvent.currentPosition;
166       break;
167     }
168
169     case Gesture::Started:
170     {
171       // Requires a core update
172       mNeedsUpdate = true;
173
174       if ( GetCurrentGesturedActor() )
175       {
176         // The pan gesture should only be sent to the gesture detector which first received it so that
177         // it can be told when the gesture ends as well.
178
179         HitTestAlgorithm::Results hitTestResults;
180         HitTest( scene, mPossiblePanPosition, hitTestResults ); // Hit test original possible position...
181
182         if ( hitTestResults.actor )
183         {
184           // Record the current render-task for Screen->Actor coordinate conversions
185           mCurrentRenderTask = hitTestResults.renderTask;
186
187           // Set mCurrentPanEvent to use inside overridden methods called in ProcessAndEmit()
188           mCurrentPanEvent = &panEvent;
189           ProcessAndEmit( hitTestResults );
190           mCurrentPanEvent = nullptr;
191         }
192         else
193         {
194           ResetActor();
195           mCurrentPanEmitters.clear();
196         }
197       }
198       break;
199     }
200
201     case Gesture::Continuing:
202     {
203       // Requires a core update
204       mNeedsUpdate = true;
205     }
206     // No break, Fallthrough
207     case Gesture::Finished:
208     case Gesture::Cancelled:
209     {
210       // Only send subsequent pan gesture signals if we processed the pan gesture when it started.
211       // Check if actor is still touchable.
212
213       Actor* currentGesturedActor = GetCurrentGesturedActor();
214       if ( currentGesturedActor )
215       {
216         if ( currentGesturedActor->IsHittable() && !mCurrentPanEmitters.empty() && mCurrentRenderTask )
217         {
218           GestureDetectorContainer outsideTouchesRangeEmitters;
219
220           // Removes emitters that no longer have the actor attached
221           // Also remove emitters whose touches are outside the range of the current pan event and add them to outsideTouchesRangeEmitters
222           GestureDetectorContainer::iterator endIter = std::remove_if( mCurrentPanEmitters.begin(), mCurrentPanEmitters.end(),
223                                                                        IsNotAttachedAndOutsideTouchesRangeFunctor(currentGesturedActor, panEvent.numberOfTouches, outsideTouchesRangeEmitters) );
224           mCurrentPanEmitters.erase( endIter, mCurrentPanEmitters.end() );
225
226           Vector2 actorCoords;
227
228           if ( !outsideTouchesRangeEmitters.empty() || !mCurrentPanEmitters.empty() )
229           {
230             currentGesturedActor->ScreenToLocal( *mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
231
232             // EmitPanSignal checks whether we have a valid actor and whether the container we are passing in has emitters before it emits the pan.
233             EmitPanSignal( currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, Gesture::Finished, mCurrentRenderTask);
234             EmitPanSignal( currentGesturedActor, mCurrentPanEmitters, panEvent, actorCoords, panEvent.state, mCurrentRenderTask);
235           }
236
237           if ( mCurrentPanEmitters.empty() )
238           {
239             // If we have no emitters attached then clear pan actor as well.
240             ResetActor();
241           }
242
243           // Clear current gesture detectors if pan gesture has ended or been cancelled.
244           if ( ( panEvent.state == Gesture::Finished ) || ( panEvent.state == Gesture::Cancelled ) )
245           {
246             mCurrentPanEmitters.clear();
247             ResetActor();
248           }
249         }
250         else
251         {
252           mCurrentPanEmitters.clear();
253           ResetActor();
254         }
255       }
256       break;
257     }
258
259     case Gesture::Clear:
260     {
261       DALI_ABORT( "Incorrect state received from Integration layer: Clear\n" );
262       break;
263     }
264   }
265 }
266
267 void PanGestureProcessor::AddGestureDetector( PanGestureDetector* gestureDetector, Scene& scene, int32_t minDistance, int32_t minPanEvents )
268 {
269   bool firstRegistration(mPanGestureDetectors.empty());
270
271   mPanGestureDetectors.push_back(gestureDetector);
272
273   if (firstRegistration)
274   {
275     mMinTouchesRequired = gestureDetector->GetMinimumTouchesRequired();
276     mMaxTouchesRequired = gestureDetector->GetMaximumTouchesRequired();
277
278     PanGestureRequest request;
279     request.minTouches = mMinTouchesRequired;
280     request.maxTouches = mMaxTouchesRequired;
281
282     Size size = scene.GetSize();
283     mGestureRecognizer = new PanGestureRecognizer(*this, Vector2(size.width, size.height), static_cast<const PanGestureRequest&>(request), minDistance, minPanEvents);
284   }
285   else
286   {
287     UpdateDetection();
288   }
289 }
290
291 void PanGestureProcessor::RemoveGestureDetector( PanGestureDetector* gestureDetector )
292 {
293   if (!mCurrentPanEmitters.empty())
294   {
295     // Check if the removed detector was one that is currently being panned and remove it from emitters.
296     GestureDetectorContainer::iterator endIter = std::remove( mCurrentPanEmitters.begin(), mCurrentPanEmitters.end(), gestureDetector );
297     mCurrentPanEmitters.erase( endIter, mCurrentPanEmitters.end() );
298
299     // If we no longer have any emitters, then we should clear mCurrentGesturedActor as well
300     if ( mCurrentPanEmitters.empty() )
301     {
302       ResetActor();
303     }
304   }
305
306   // Find the detector...
307   PanGestureDetectorContainer::iterator endIter = std::remove( mPanGestureDetectors.begin(), mPanGestureDetectors.end(), gestureDetector );
308   DALI_ASSERT_DEBUG( endIter != mPanGestureDetectors.end() );
309
310   // ...and remove it
311   mPanGestureDetectors.erase(endIter, mPanGestureDetectors.end());
312
313   if (mPanGestureDetectors.empty())
314   {
315     mGestureRecognizer.Detach();
316   }
317   else
318   {
319     UpdateDetection();
320   }
321 }
322
323 void PanGestureProcessor::GestureDetectorUpdated( PanGestureDetector* gestureDetector )
324 {
325   DALI_ASSERT_DEBUG(find(mPanGestureDetectors.begin(), mPanGestureDetectors.end(), gestureDetector) != mPanGestureDetectors.end());
326
327   UpdateDetection();
328 }
329
330 bool PanGestureProcessor::SetPanGestureProperties( const PanGesture& pan )
331 {
332   // If we are currently processing a pan gesture then just ignore
333   if ( mCurrentPanEmitters.empty() && mSceneObject )
334   {
335     // We update the scene object directly rather than sending a message.
336     // Sending a message could cause unnecessary delays, the scene object ensure thread safe behaviour.
337     mSceneObject->AddGesture( pan );
338
339     if( Gesture::Started == pan.state || Gesture::Continuing == pan.state )
340     {
341       mNeedsUpdate = true;
342     }
343   }
344
345   return mNeedsUpdate;
346 }
347
348 void PanGestureProcessor::EnableProfiling()
349 {
350   mSceneObject->EnableProfiling();
351 }
352
353 void PanGestureProcessor::SetPredictionMode(int mode)
354 {
355   if( (mode < 0)
356       || (mode >= SceneGraph::PanGesture::NUM_PREDICTION_MODES) )
357   {
358     mode = SceneGraph::PanGesture::DEFAULT_PREDICTION_MODE;
359   }
360   SceneGraph::PanGesture::PredictionMode modeEnum = static_cast<SceneGraph::PanGesture::PredictionMode>(mode);
361   mSceneObject->SetPredictionMode(modeEnum);
362 }
363
364 void PanGestureProcessor::SetPredictionAmount(unsigned int amount)
365 {
366   mSceneObject->SetPredictionAmount(amount);
367 }
368
369 void PanGestureProcessor::SetMaximumPredictionAmount(unsigned int amount)
370 {
371   mSceneObject->SetMaximumPredictionAmount(amount);
372 }
373
374 void PanGestureProcessor::SetMinimumPredictionAmount(unsigned int amount)
375 {
376   mSceneObject->SetMinimumPredictionAmount(amount);
377 }
378
379 void PanGestureProcessor::SetPredictionAmountAdjustment(unsigned int amount)
380 {
381   mSceneObject->SetPredictionAmountAdjustment(amount);
382 }
383
384 void PanGestureProcessor::SetSmoothingMode(int mode)
385 {
386   if( (mode < 0)
387       || (mode >= SceneGraph::PanGesture::NUM_SMOOTHING_MODES) )
388   {
389     mode = SceneGraph::PanGesture::DEFAULT_SMOOTHING_MODE;
390   }
391   SceneGraph::PanGesture::SmoothingMode modeEnum = static_cast<SceneGraph::PanGesture::SmoothingMode>(mode);
392   mSceneObject->SetSmoothingMode(modeEnum);
393 }
394
395 void PanGestureProcessor::SetSmoothingAmount(float amount)
396 {
397   mSceneObject->SetSmoothingAmount(amount);
398 }
399
400 void PanGestureProcessor::SetUseActualTimes( bool value )
401 {
402   mSceneObject->SetUseActualTimes( value );
403 }
404
405 void PanGestureProcessor::SetInterpolationTimeRange( int value )
406 {
407   mSceneObject->SetInterpolationTimeRange( value );
408 }
409
410 void PanGestureProcessor::SetScalarOnlyPredictionEnabled( bool value )
411 {
412   mSceneObject->SetScalarOnlyPredictionEnabled( value );
413 }
414
415 void PanGestureProcessor::SetTwoPointPredictionEnabled( bool value )
416 {
417   mSceneObject->SetTwoPointPredictionEnabled( value );
418 }
419
420 void PanGestureProcessor::SetTwoPointInterpolatePastTime( int value )
421 {
422   mSceneObject->SetTwoPointInterpolatePastTime( value );
423 }
424
425 void PanGestureProcessor::SetTwoPointVelocityBias( float value )
426 {
427   mSceneObject->SetTwoPointVelocityBias( value );
428 }
429
430 void PanGestureProcessor::SetTwoPointAccelerationBias( float value )
431 {
432   mSceneObject->SetTwoPointAccelerationBias( value );
433 }
434
435 void PanGestureProcessor::SetMultitapSmoothingRange( int value )
436 {
437   mSceneObject->SetMultitapSmoothingRange( value );
438 }
439
440 const SceneGraph::PanGesture& PanGestureProcessor::GetSceneObject() const
441 {
442   return *mSceneObject;
443 }
444
445 void PanGestureProcessor::UpdateDetection()
446 {
447   DALI_ASSERT_DEBUG(!mPanGestureDetectors.empty());
448
449   unsigned int minimumRequired = UINT_MAX;
450   unsigned int maximumRequired = 0;
451
452   for ( PanGestureDetectorContainer::iterator iter = mPanGestureDetectors.begin(), endIter = mPanGestureDetectors.end(); iter != endIter; ++iter )
453   {
454     PanGestureDetector* detector(*iter);
455
456     if( detector )
457     {
458       unsigned int minimum = detector->GetMinimumTouchesRequired();
459       if (minimum < minimumRequired)
460       {
461         minimumRequired = minimum;
462       }
463
464       unsigned int maximum = detector->GetMaximumTouchesRequired();
465       if (maximum > maximumRequired)
466       {
467         maximumRequired = maximum;
468       }
469     }
470   }
471
472   if ( (minimumRequired != mMinTouchesRequired)||(maximumRequired != mMaxTouchesRequired) )
473   {
474     mMinTouchesRequired = minimumRequired;
475     mMaxTouchesRequired = maximumRequired;
476
477     PanGestureRequest request;
478     request.minTouches = mMinTouchesRequired;
479     request.maxTouches = mMaxTouchesRequired;
480     mGestureRecognizer->Update(request);
481   }
482 }
483
484 void PanGestureProcessor::EmitPanSignal( Actor* actor,
485                                          const GestureDetectorContainer& gestureDetectors,
486                                          const PanGestureEvent& panEvent,
487                                          Vector2 localCurrent,
488                                          Gesture::State state,
489                                          RenderTaskPtr renderTask )
490 {
491   if ( actor && !gestureDetectors.empty() )
492   {
493     PanGesture pan(state);
494     pan.time = panEvent.time;
495
496     pan.numberOfTouches = panEvent.numberOfTouches;
497     pan.screenPosition = panEvent.currentPosition;
498     pan.position = localCurrent;
499
500     RenderTask& renderTaskImpl( *renderTask.Get() );
501
502     Vector2 localPrevious;
503     actor->ScreenToLocal( renderTaskImpl, localPrevious.x, localPrevious.y, panEvent.previousPosition.x, panEvent.previousPosition.y );
504
505     pan.displacement = localCurrent - localPrevious;
506     Vector2 previousPos( panEvent.previousPosition );
507     if ( state == Gesture::Started )
508     {
509       previousPos = mPossiblePanPosition;
510     }
511
512     pan.screenDisplacement = panEvent.currentPosition - previousPos;
513
514     // Avoid dividing by 0
515     if ( panEvent.timeDelta > 0 )
516     {
517       pan.velocity.x = pan.displacement.x / static_cast<float>( panEvent.timeDelta );
518       pan.velocity.y = pan.displacement.y / static_cast<float>( panEvent.timeDelta );
519
520       pan.screenVelocity.x = pan.screenDisplacement.x / static_cast<float>( panEvent.timeDelta );
521       pan.screenVelocity.y = pan.screenDisplacement.y / static_cast<float>( panEvent.timeDelta );
522     }
523
524     // When the gesture ends, we may incorrectly get a ZERO velocity (as we have lifted our finger without any movement)
525     // so we should use the last recorded velocity instead in this scenario.
526     if ( ( state == Gesture::Finished ) && ( pan.screenVelocity == Vector2::ZERO ) &&
527          ( panEvent.timeDelta < MAXIMUM_TIME_WITH_VALID_LAST_VELOCITY ) )
528     {
529       pan.velocity = mLastVelocity;
530       pan.screenVelocity = mLastScreenVelocity;
531     }
532     else
533     {
534       // Store the current velocity for future iterations.
535       mLastVelocity = pan.velocity;
536       mLastScreenVelocity = pan.screenVelocity;
537     }
538
539     if ( mSceneObject )
540     {
541       // We update the scene object directly rather than sending a message.
542       // Sending a message could cause unnecessary delays, the scene object ensure thread safe behaviour.
543       mSceneObject->AddGesture( pan );
544     }
545
546     Dali::Actor actorHandle( actor );
547
548     const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
549     for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter )
550     {
551       static_cast< PanGestureDetector* >( *iter )->EmitPanGestureSignal( actorHandle, pan );
552     }
553   }
554 }
555
556 void PanGestureProcessor::OnGesturedActorStageDisconnection()
557 {
558   mCurrentPanEmitters.clear();
559 }
560
561 bool PanGestureProcessor::CheckGestureDetector( GestureDetector* detector, Actor* actor )
562 {
563   DALI_ASSERT_DEBUG( mCurrentPanEvent );
564
565   bool retVal( false );
566   PanGestureDetector* panDetector( static_cast< PanGestureDetector* >( detector ) );
567
568   if ( ( mCurrentPanEvent->numberOfTouches >= panDetector->GetMinimumTouchesRequired() ) &&
569        ( mCurrentPanEvent->numberOfTouches <= panDetector->GetMaximumTouchesRequired() ) )
570   {
571     // Check if the detector requires directional panning.
572     if ( panDetector->RequiresDirectionalPan() && mCurrentRenderTask )
573     {
574       // It does, calculate the angle of the pan in local actor coordinates and ensures it fits
575       // the detector's criteria.
576       RenderTask& renderTaskImpl = *mCurrentRenderTask.Get();
577
578       Vector2 startPosition, currentPosition;
579       actor->ScreenToLocal( renderTaskImpl, startPosition.x,   startPosition.y,   mPossiblePanPosition.x,              mPossiblePanPosition.y );
580       actor->ScreenToLocal( renderTaskImpl, currentPosition.x, currentPosition.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y );
581       Vector2 displacement( currentPosition - startPosition );
582
583       Radian angle( atanf( displacement.y / displacement.x ) );
584
585       /////////////////////////////
586       //            |            //
587       //            |            //
588       //   Q3 (-,-) | Q4 (+,-)   //
589       //            |            //
590       //    ----------------- +x //
591       //            |            //
592       //   Q2 (-,+) | Q1 (+,+)   //
593       //            |            //
594       //            |            //
595       //           +y            //
596       /////////////////////////////
597       // Quadrant 1: As is
598       // Quadrant 2: 180 degrees + angle
599       // Quadrant 3: angle - 180 degrees
600       // Quadrant 4: As is
601       /////////////////////////////
602
603       if ( displacement.x < 0.0f )
604       {
605         if ( displacement.y >= 0.0f )
606         {
607           // Quadrant 2
608           angle.radian += Math::PI;
609         }
610         else
611         {
612           // Quadrant 3
613           angle.radian -= Math::PI;
614         }
615       }
616
617       if ( panDetector->CheckAngleAllowed( angle ) )
618       {
619         retVal = true;
620       }
621     }
622     else
623     {
624       // Directional panning not required so we can use this actor and gesture detector.
625       retVal = true;
626     }
627   }
628   return retVal;
629 }
630
631 void PanGestureProcessor::EmitGestureSignal( Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates )
632 {
633   DALI_ASSERT_DEBUG ( mCurrentPanEvent );
634
635   mCurrentPanEmitters.clear();
636   ResetActor();
637
638   actor->ScreenToLocal( *mCurrentRenderTask.Get(), actorCoordinates.x, actorCoordinates.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y );
639
640   EmitPanSignal( actor, gestureDetectors, *mCurrentPanEvent, actorCoordinates, mCurrentPanEvent->state, mCurrentRenderTask );
641
642   if ( actor->OnStage() )
643   {
644     mCurrentPanEmitters = gestureDetectors;
645     SetActor( actor );
646   }
647 }
648
649 } // namespace Internal
650
651 } // namespace Dali