-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pan and Swipe Release #32
Comments
No swipe gesture is used in touch scrolling with snapping (paging). It's just pan + velocity and offsets. In iOS.. and pretty much sure in Android (that's a mess). Are you really doing something better than https://github.com/fljot/TouchScrolling/blob/features/decoupled-architecture/src/com/inreflected/ui/touchScroll/TouchScrollModel.as (NB! not finished) ? |
Ah, that's what I was starting to think. We'll check out the TouchScrollModel next! We're still having trouble loading your examples folders into Flash Builder. What project type is recommended: Flex Mobile? Actionscript Mobile? Thanks, fljot. Keep up the great work! |
While working on velocity calculations we're noticing that pan.offsetX and pan.offsetY are returning 0 on every other offset: 0, 0 Is this the intended behavior? We're still working from your "Gestouch-slop-hotfix" branch. |
No, this is definitely not intended behavior. Offset should always have some "length", otherwise it's not really a "change". I encourage you to investigate it =) Are you sure this event handler is for single gesture only and you are actually getting the offset from that gesture? |
Yes, it's very basic and shouldn't have interference from anything else. We even created a test in the root of our Starling project and removed any content besides the stage: Main Class Initialization
Starling "Game" class
We see the same result using the 0.4.3 SWC as well as the 'Gestouch-slop-hotfix' branch. If the PanGesture is designed to return decimals, we're only getting INTs. I'm wondering if something is rounding or zeroing the offsets out. |
It's only one place where |
pan.location SHOULD change everytime...we're touching an and object and then dragging it around in a circle as smoothly as possible. Some zeros are definitely natural, but pan is returning them literally every other cycle. There is only one touch, one gesture listener, one gesture of any kind (hence why we removed our custom Starling code just to be sure). We've got traces throughout PanGesture.as and Gesture.as. Here's a tracelog from our circular drag motion:
Obviously, the offsets are 0 because touchLocation and centralPoint are the same, but I'm trying to figure out what is happening to the prevLocationX and prevLocationY values because, as you said, they have to be different during a CHANGE event. |
In the PanGesture.as onTouchMove() the updateLocation() call near line 165 returns the same value for _location so the offsets are calculated as 0. I can't notice anything immediately wrong with how the methods work, but maybe the values are being updated before the difference calculation occurs? |
Like if |
Wow, maybe so. Some of the cycles do have the same time and it seems to correlate to when the offsets are 0:
|
In |
They have the same time stamps, but I'm not sure if that signifies a repetitious call:
Here is the GestureManager.as with trace:
|
I hope this is helpful. We don't want to get too deep and try debugging your work because we'd probably do more harm than good =) |
No, you got me wrong. Trace before while and after while, this way we can see if gesture call is triggered twice per cycle (which should not happen normally). |
Got it. Is this what you're looking for? There are still duplicates on every other call (signified between the trace linebreaks I added): Before While 2705 Before While 2707 Before While 2722 Before While 2722 Before While 2738 Before While 2739 Before While 2772 Before While 2772 Before While 2788 Before While 2789 Before While 2805 Before While 2805
|
Noooo =))) keep the traces in gesture or handler also) this way we can see if theres sequence like "before, handler, handler, after" — there's bug in manager. If it's "before, handler, after" — manager is fine and dammit wtf. |
I see. Added traces back to the PanGesture.as onTouchMove(). That appears to only be called once =) Before While 1141 Before While 1157 Before While 1157 Before While 1175 Before While 1175 Before While 1189 Before While 1189 Before While 1206 Before While 1206 Relevant portion of PanGesture.as onTouchMove:
|
Great. So I found out that native event TouchEvent.TOUCH_MOVE is dispatched even when it's locations is the same, but touch size has changed. So try this commit 4398712 |
Nice. We'll try this version asap and see how things go. Having the extra cycles really didn't cause problems, but fixing it will hopefully benefit performance. |
Well actually I consider it as a bug since no actual move was happening. And other than conceptual confusion it also could lead to wrong velocity calculation. |
Hi fljot,
Thanks to your help in Issue 18, we have both Pan and Swipe gestures recognized now! However, we still can't accomplish something we see commonly among (ie.) photo viewer applications on Android and iOS:
Since the GesTouch SWIPE doesn't consider touch points, is their a way to accomplish using native GesTouch gestures or will we have to perform our own swipe recognition within the PAN CHANGED event? (For example, checking for a minimum velocity and listening for a TOUCH END event).
Thank you very much!
The text was updated successfully, but these errors were encountered: