It should be touched as much as the area set by the TOUCH_AREA property in the View. 93/255093/3
authorJoogab Yun <joogab.yun@samsung.com>
Fri, 12 Mar 2021 02:51:25 +0000 (11:51 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Mon, 15 Mar 2021 01:19:00 +0000 (01:19 +0000)
There was no consideration for TouchArea in SphereTest().

For information 'TouchArea' sets the touch area of ​​the View.

Change-Id: Iad3431fc4b6fdb4d971dd0a1e8e158ad42241dbb

automated-tests/src/dali/utc-Dali-TouchProcessing.cpp
dali/internal/event/events/ray-test.cpp

index d8bdafd..5f2d395 100644 (file)
@@ -2170,7 +2170,7 @@ int UtcDaliTouchArea(void)
   application.Render();
 
   // Emit a down signal
-  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(110.0f, 110.0f)));
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(150.0f, 150.0f)));
   // The actor touched signal is called because the touch area is inside touchArea.
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(PointState::DOWN, data.receivedTouch.points[0].state, TEST_LOCATION);
index 87979c6..8659edf 100644 (file)
@@ -108,7 +108,7 @@ bool RayTest::SphereTest(const Internal::Actor& actor, const Vector4& rayOrigin,
   const Node&       node        = actor.GetNode();
   const BufferIndex bufferIndex = EventThreadServices::Get().GetEventBufferIndex();
   const Vector3&    translation = node.GetWorldPosition(bufferIndex);
-  const Vector3&    size        = node.GetSize(bufferIndex);
+  const Vector3&    size        = actor.GetTouchArea() == Vector2::ZERO ? node.GetSize(bufferIndex) : Vector3(actor.GetTouchArea());
   const Vector3&    scale       = node.GetWorldScale(bufferIndex);
 
   // Transforms the ray to the local reference system. As the test is against a sphere, only the translation and scale are needed.