[Tizen] If MaximumTapsRequired is 1, it is not waiting for a multi-tap, so a Tap... 79/270979/1
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 10 Feb 2022 05:00:00 +0000 (14:00 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Mon, 14 Feb 2022 00:16:52 +0000 (09:16 +0900)
Even if set to tapGestureDetector.SetMaximumTapsRequired(1);
When user tap multiple times quickly, the tap gesture event now fires only once every maximum Allowed Time (500ms).

If MaximumTapsRequired is 1, user want to receive tap gesture events immediately because we are not waiting for a multi-tap.

Change-Id: I9651facb9650982e2e0dc414974677c531481bf8

dali/internal/event/events/tap-gesture/tap-gesture-recognizer.cpp

index b1799c1..7d33bb4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -137,7 +137,8 @@ void TapGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
           // This is a possible multiple tap, so has it been quick enough?
           uint32_t timeDelta                    = event.time - mLastTapTime;
           uint32_t deltaBetweenTouchDownTouchUp = event.time - mTouchTime;
-          if(timeDelta > mMaximumAllowedTime) // If exceeded time between taps then just a single tap
+          if(timeDelta > mMaximumAllowedTime || // If exceeded time between taps then just a single tap
+             mMaximumTapsRequired == 1u)        // If MaximumTapsRequired is 1, it is not waiting for a multi-tap, so a Tap gesture send a single tap.
           {
             mLastTapTime = event.time;
             EmitSingleTap(event.time, point);