You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately GESTURE_DOUBLETAP appears to have a timing issue on all platforms.
It appears that the problem is the TAP_TIMEOUT value (rgestures.h#L184). rgesture.h comments mention time being in milliseconds, but, in fact, it's all being handled in seconds from GetTime()(rgestures.h#L531) while using rgestures.h with raylib. So the inconsistency of GESTURE_DOUBLETAP was that it had an "open window" of 300 seconds instead of 300 milliseconds.
Proposed solution
The most straightforward solution (since rgGetCurrentTime()(rgestures.h#L526) is already returning the time in seconds) is to convert TAP_TIMEOUT to seconds (and also PINCH_TIMEOUT since we're already there, although it's not being used at the moment) and fix the rgesture.h comments to replace milliseconds with seconds.
For consistency, it's also necessary to adjust the rgGetCurrentTime() standalone implementations (rgestures.h#L530-L566) so they also return time in seconds.
Will send a PR with the proposed changes shortly.
Environment
Platform: Linux
Operating System: Linux Mint 21.1 (x86_64)
OpenGL version: 3.1 Mesa 22.0.5
GPU: Intel HD Graphics 3000
@ubkp Thanks for the review! rgestures had not been reviewed in a long time and it required several improvements. Using seconds for time measures is the most standard and logic option, actually, it was already adopted for raylib long time ago.
Issue description
Unfortunately
GESTURE_DOUBLETAP
appears to have a timing issue on all platforms.It appears that the problem is the
TAP_TIMEOUT
value (rgestures.h#L184).rgesture.h
comments mention time being inmilliseconds
, but, in fact, it's all being handled inseconds
fromGetTime()
(rgestures.h#L531) while usingrgestures.h
withraylib
. So the inconsistency ofGESTURE_DOUBLETAP
was that it had an "open window" of300 seconds
instead of300 milliseconds
.Proposed solution
The most straightforward solution (since
rgGetCurrentTime()
(rgestures.h#L526) is already returning the time inseconds
) is to convertTAP_TIMEOUT
toseconds
(and alsoPINCH_TIMEOUT
since we're already there, although it's not being used at the moment) and fix thergesture.h
comments to replacemilliseconds
withseconds
.For consistency, it's also necessary to adjust the
rgGetCurrentTime()
standalone implementations (rgestures.h#L530-L566) so they also return time inseconds
.Will send a PR with the proposed changes shortly.
Environment
Platform: Linux
Operating System: Linux Mint 21.1 (x86_64)
OpenGL version: 3.1 Mesa 22.0.5
GPU: Intel HD Graphics 3000
Platform: Android
Operating System: Android 5.1.1
OpenGL version: OpenGL ES 1.1/2.0
GPU: Mali-400
Issue Screenshot
Code Example
Minimal reproduction code to test the issue:
The text was updated successfully, but these errors were encountered: