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));
}
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)))
{
// 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
// 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)
{
// 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;
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)