fljot / Gestouch

Gestouch: multitouch gesture recognition library for Flash (ActionScript) development.
MIT License
355 stars 85 forks source link

onTouchEnd function was setting wrong state via setState- CHANGED, in… #87

Closed syberkitten closed 9 years ago

syberkitten commented 9 years ago

Hi,

Great Project, by the way :+1: Had a bug where onTouchEnd function was setting wrong state via setState- CHANGED, instead of ENDED, thus ENDED listener was never evoked for GestureEvent.ENDED, when there is at least one active touch event. (only CHANGED was evoked, as expected in the code)

side effects

I'm not very familiar with this framework, but perhaps it affects ended events sent when multitouch is used?

for me it works now, both for singe touch point, and when two touch points are being active, for instance when rotating an image, so i did not experience any side effects yet.

Tested on AIR for Windows and for Mobile Android (sdk version 18) using normal displaylist instances (not starling)

fljot commented 9 years ago

@syberkitten commented on the line

syberkitten commented 9 years ago

I know it sounds strange, but I was experiencing some instability, where one touch point was not sending an ENDED event, only when using two fingers.

thus i was not able to detect an END event, only after this hack. I will do some more testing, and try to pinpoint the issue if it re-occurs..

for example (not for this scope) when testing on a PC (windows) there is a 50% chance that TapGesture is not detected when using mouse click. It's completely non-deterministic, one compile it works, in the other it doesn't as if some internal ordering is disturbed.

anyway, thanks for stepping forward :) and i hope to have a more accurate view on the issue as we continue developing our project

fljot commented 9 years ago

@syberkitten yeah please don't abandon this issue! I have added some logging to help resolve some weird issues https://github.com/fljot/Gestouch/commit/7d929b23b6482e2448ef18ab412d27fae4c2a325 (to enable it you should compile against sources with compilation flag CONFIG::GestouchDebug set to true, I hope you know what I'm talking about). Logic in transform gesture looks right to me.. So something must be with input (touch IDs and stuff).

fljot commented 9 years ago

@syberkitten any updates?

syberkitten commented 9 years ago

Thanks for bugging me, as I quite heavily rely on this Library in my project, and would like to help it live :)

issue is, since my last claim the issue has stopped occurring, probably since the conditions in my code has changed as well.

I was first using the idea of attaching a gesture for each element, in my case transformed images, using the standard display list.

as my project evolved I've moved to a global stage (container) single TransformGesture instance which allows me to manipulate the objects below in a much more accurate fashion, for example such as selecting an object between transparent top layers, something that is not possible when attaching a gesture to the image itself (as the gesture has to exist even if no object is there)

this definitely has it's own limitations, such as inability to move more then one object simultaneously. Unless an array of the currently active touch points and their location (xy) are also provided to the gesture instance coming with the GestureEvent,

could this be done easily? I'd be glad to contribute to the code if i knew the underlying architecture better... (and not just play around with guess work)

regarding compilation of the project and debugging, I see that you are heavily relying on MXML, are you using the flex builder? or the Apache flex?

ps. My tools are IntelliJ IDea 14 with AIR SDK 17-18 and Flash Pro IDE (CS6)

syberkitten commented 9 years ago

is the CONFIG::GestouchDebug directive recognized by the AIR SDK or is it a feature of only the flex compiler? ...