return touchEvent;
}
+Integration::TouchEvent GenerateDoubleTouch(PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time)
+{
+ Integration::TouchEvent touchEvent;
+ Integration::Point point;
+ point.SetState(stateA);
+ point.SetDeviceId(4);
+ point.SetScreenPosition(screenPositionA);
+ point.SetDeviceClass(Device::Class::TOUCH);
+ point.SetDeviceSubclass(Device::Subclass::NONE);
+ touchEvent.points.push_back(point);
+ point.SetScreenPosition(screenPositionB);
+ point.SetState(stateB);
+ point.SetDeviceId(7);
+ point.SetDeviceClass(Device::Class::TOUCH);
+ point.SetDeviceSubclass(Device::Subclass::NONE);
+ touchEvent.points.push_back(point);
+ touchEvent.time = time;
+ return touchEvent;
+}
+
} // namespace
///////////////////////////////////////////////////////////////////////////////
END_TEST;
}
+int UtcDaliTouchEventCapturePropertySetWithMultiTouch(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ application.GetScene().Add(actor);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Connect to actor's touched signal
+ SignalData data;
+ TouchEventFunctor functor(data);
+ actor.TouchedSignal().Connect(&application, functor);
+
+ // Now set the capture property
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, true);
+
+ // Emit a down signal
+ application.ProcessEvent(GenerateDoubleTouch(PointState::STARTED, Vector2(10.0f, 10.0f), PointState::STARTED, Vector2(15.0f, 15.0f), 200));
+ DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
+ data.Reset();
+
+ // Now motion outside of actor, we now SHOULD receive the event
+ application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(110.0f, 110.0f), PointState::MOTION, Vector2(115.0f, 115.0f), 210));
+ DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
+ data.Reset();
+
+ // Up event, we should receive it again, but as ended rather than interrupted
+ application.ProcessEvent(GenerateDoubleTouch(PointState::FINISHED, Vector2(110.0f, 110.0f), PointState::FINISHED, Vector2(115.0f, 115.0f), 220));
+ DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
+ DALI_TEST_EQUALS(data.receivedTouch.GetPoint(0).state, PointState::FINISHED, TEST_LOCATION);
+ DALI_TEST_EQUALS(data.receivedTouch.GetPoint(1).state, PointState::FINISHED, TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliTouchEventIntegNewTouchEvent(void)
{
uint32_t timestamp = 92858u;
}
else
{
- HitTestAlgorithm::HitTest(mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), currentPoint.GetScreenPosition(), hitTestResults, nullptr, localVars.isGeometry);
+ Actor* capturingTouchActor = mCapturingTouchActor.GetActor();
+ if(capturingTouchActor && mLastRenderTask)
+ {
+ hitTestResults.actor = Dali::Actor(capturingTouchActor);
+ hitTestResults.renderTask = mLastRenderTask;
+ const Vector2& screenPosition = currentPoint.GetScreenPosition();
+ capturingTouchActor->ScreenToLocal(*mLastRenderTask, hitTestResults.actorCoordinates.x, hitTestResults.actorCoordinates.y, screenPosition.x, screenPosition.y);
+ }
+ else
+ {
+ HitTestAlgorithm::HitTest(mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), currentPoint.GetScreenPosition(), hitTestResults, nullptr, localVars.isGeometry);
+ }
}
Integration::Point newPoint(currentPoint);