From: joogab.yun Date: Wed, 16 Mar 2022 02:19:22 +0000 (+0900) Subject: If CapturesAllTouchAfterStart() is true, it should be hit only after touchdown. X-Git-Tag: dali_2.1.16~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F272403%2F3;p=platform%2Fcore%2Fuifw%2Fdali-core.git If CapturesAllTouchAfterStart() is true, it should be hit only after touchdown. So, If the touch moves after another actor has been touched so that the current actor is hit, it should behave as if it didn't hit. Change-Id: I609607ea19a5cf5f6b07b5065132f491122f7a6b --- diff --git a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp index d39266a..13e1eba 100644 --- a/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp +++ b/automated-tests/src/dali/utc-Dali-TouchProcessing.cpp @@ -2104,6 +2104,22 @@ int UtcDaliTouchEventCapturePropertySet(void) application.ProcessEvent(GenerateSingleTouch(PointState::FINISHED, Vector2(110.0f, 110.0f))); DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION); DALI_TEST_EQUALS(data.receivedTouch.GetPoint(0).state, PointState::FINISHED, TEST_LOCATION); + data.Reset(); + + // Emit a down outside of actor, we should not receive the event + application.ProcessEvent(GenerateSingleTouch(PointState::STARTED, Vector2(110.0f, 110.0f))); + DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + data.Reset(); + + // Now motion inside of actor, we should not receive the event, Because the touchdown didn't happen inside the actor. + application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(10.0f, 10.0f))); + DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + data.Reset(); + + // Up event, we should not receive the event, Because the touchdown didn't happen inside the actor. + application.ProcessEvent(GenerateSingleTouch(PointState::FINISHED, Vector2(110.0f, 110.0f))); + DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + data.Reset(); END_TEST; } diff --git a/dali/internal/event/events/hit-test-algorithm-impl.cpp b/dali/internal/event/events/hit-test-algorithm-impl.cpp index 81bf36a..5330fe3 100644 --- a/dali/internal/event/events/hit-test-algorithm-impl.cpp +++ b/dali/internal/event/events/hit-test-algorithm-impl.cpp @@ -257,6 +257,13 @@ HitActor HitTestWithinLayer(Actor& actor, } } + // If CapturesAllTouchAfterStart() is true, it should be hit only after touchdown. + // If the touch moves after another actor has been touched so that the current actor is hit, it should behave as if it didn't hit. + if(actor.CapturesAllTouchAfterStart() && point.GetState() != PointState::STARTED) + { + haveHitActor = false; + } + // If the hit actor does not want to hit, the hit-test continues. if(haveHitActor && hitCheck.ActorRequiresHitResultCheck(&actor, point, hitPointLocal, eventTime)) {