[TIMOB-1277] Touchmove not tracking properly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-06-22T12:57:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2012-13 API |
Components | iOS |
Labels | api |
Reporter | Tony Masciola |
Assignee | Vishal Duggal |
Created | 2011-04-15T02:48:20.000+0000 |
Updated | 2017-05-30T17:28:21.000+0000 |
Description
Code similar to the following used to work fine, prior to 1.4 RC1:
http://developer.appcelerator.com/question/28951/to-drag-and-drop-or-not"> http://developer.appcelerator.com/question/28951/to-drag-and-drop-o...
The object would move with the touchmove coordinates and, although at times a bit laggy, would move right along from the touchstart coordinates to touchend. Now it's as if there are multiple events being fired with varying coordinates because the object jumps all over the screen and falls behind as you "drag" the object in a straight line from one point to another.
Or take a more straight-forward example like this to see how the object tracks behind the current touch position and never catches up:
//Box is a box to be dragged (I've tested with an imageview and
label with same result) box.addEventListener("touchmove",
function(e){
e.source.center = {x:e.x,y:e.y};
});
Sorry, formatting problem on the code:
Encountering the same issue with touchmove event on a View object.
Still valid; can be seen in KS->Base UI->Animations when you try and drag the circle.
this was assigned to me but should go to someone else
I have the same problem with Android and solved it. Modify the file android/titanium/src/org/appcelerator/titanium/view/TiUIView.java change the function dictFromEvent with this one:
Now you can execute a simple test app:
Based on the tests on a lot of drag and drop codes, this problem arises for me when a layout property is defined in the parent view. The touchmove coordinates works fine when the parent view's layout is not defined. When there is a 'horizontal' or 'vertical' layout, the touchmove corrdinates are 'jumping' around. The same problem persists when using convertPointToView as well.
convert to window co-ordinates