{ "id": "61909", "key": "TIMOB-1277", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13417", "description": "Sprint 2012-13 API", "name": "Sprint 2012-13 API", "archived": true, "released": true, "releaseDate": "2012-07-01" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-06-22T12:57:03.000+0000", "created": "2011-04-15T02:48:20.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "api" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-30T17:28:21.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Code similar to the following used to work fine, prior to 1.4\r\nRC1:

\r\n

\r\nhttp://developer.appcelerator.com/question/28951/to-drag-and-drop-o...

\r\n

The object would move with the touchmove coordinates and,\r\nalthough at times a bit laggy, would move right along from the\r\ntouchstart coordinates to touchend. Now it's as if there are\r\nmultiple events being fired with varying coordinates because the\r\nobject jumps all over the screen and falls behind as you \"drag\" the\r\nobject in a straight line from one point to another.

\r\n

Or take a more straight-forward example like this to see how the\r\nobject tracks behind the current touch position and never catches\r\nup:

\r\n

//Box is a box to be dragged (I've tested with an imageview and\r\nlabel with same result) box.addEventListener(\"touchmove\",\r\nfunction(e){

\r\n
\r\n   e.source.center = {x:e.x,y:e.y};\r\n
\r\n

});

{html}", "attachment": [], "flagged": false, "summary": "Touchmove not tracking properly", "creator": { "name": "tonymasciola", "key": "tonymasciola", "displayName": "Tony Masciola", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tonymasciola", "key": "tonymasciola", "displayName": "Tony Masciola", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125234", "author": { "name": "tonymasciola", "key": "tonymasciola", "displayName": "Tony Masciola", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Sorry, formatting problem on the code:

\n
\n//Box is a box to be dragged (I've tested with an imageview and label with same result) \nbox.addEventListener(\"touchmove\", function(e){\n   e.source.center = {x:e.x,y:e.y};\n});\n
{html}", "updateAuthor": { "name": "tonymasciola", "key": "tonymasciola", "displayName": "Tony Masciola", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:21.000+0000", "updated": "2011-04-15T02:48:21.000+0000" }, { "id": "125235", "author": { "name": "daniyal", "key": "daniyal", "displayName": "daniyal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Encountering the same issue with touchmove event on a View\nobject.

{html}", "updateAuthor": { "name": "daniyal", "key": "daniyal", "displayName": "daniyal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:22.000+0000", "updated": "2011-04-15T02:48:22.000+0000" }, { "id": "125236", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Still valid; can be seen in KS->Base UI->Animations when\nyou try and drag the circle.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:48:22.000+0000", "updated": "2011-04-15T02:48:22.000+0000" }, { "id": "132954", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "this was assigned to me but should go to someone else", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-28T23:52:45.000+0000", "updated": "2011-04-28T23:52:45.000+0000" }, { "id": "166868", "author": { "name": "cougaro", "key": "cougaro", "displayName": "Giuseppe Mastrangelo", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have the same problem with Android and solved it. \r\n\r\nModify the file android/titanium/src/org/appcelerator/titanium/view/TiUIView.java change the function \r\ndictFromEvent with this one:\r\n\r\n{code:title=TiUIView.java|borderStyle=solid} \r\n private KrollDict dictFromEvent(MotionEvent e)\r\n {\r\n KrollDict data = new KrollDict();\r\n /* original...\r\n data.put(TiC.EVENT_PROPERTY_X, (double)e.getX());\r\n data.put(TiC.EVENT_PROPERTY_Y, (double)e.getY());\r\n */\r\n data.put(TiC.EVENT_PROPERTY_X, (double)e.getRawX());\r\n data.put(TiC.EVENT_PROPERTY_Y, (double)e.getRawY());\r\n data.put(TiC.EVENT_PROPERTY_SOURCE, proxy);\r\n return data;\r\n }\r\n{code}\r\n\r\nNow you can execute a simple test app: \r\n\r\n{code:title=app.js|borderStyle=solid}\r\n// Just past me into into a blank app.js file and run\r\nwindow = Titanium.UI.createWindow({\r\n backgroundColor:'#47a',\r\n exitOnClose: true\r\n});\r\n\r\nvar image = Titanium.UI.createView({\r\n backgroundColor:'#f00',\r\n borderRadius:50,\r\n height:100,\r\n width:100,\r\n left:100,\r\n top:100\r\n});\r\n\r\nvar debugLabel = Titanium.UI.createLabel({\r\n\tleft:0,\r\n\ttop:0,\r\n\tcolor:'#fff',\r\n\ttext:''\r\n});\r\nwindow.add(debugLabel);\r\n \r\n//make the image dragable\r\nimage.addEventListener('touchstart', function (e) {\r\n\tdebugLabel.text = \"TOUCHSTART \"+JSON.stringify(e);\r\n});\r\nimage.addEventListener('touchmove', function (e) {\r\n\tdebugLabel.text = JSON.stringify(e);\r\n\timage.center = {\r\n\t\tx:e.x,\r\n\t\ty:e.y\r\n\t};\r\n});\r\n\r\nimage.addEventListener('touchend', function (e) {\r\n\tdebugLabel.text = \"TOUCHEND \"+JSON.stringify(e);\r\n}); \r\n\r\nwindow.add(image);\r\nwindow.open({fullscreen:true});\r\n{code}\r\n", "updateAuthor": { "name": "cougaro", "key": "cougaro", "displayName": "Giuseppe Mastrangelo", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-24T09:03:53.000+0000", "updated": "2011-09-24T09:05:32.000+0000" }, { "id": "186423", "author": { "name": "ckng", "key": "ckng", "displayName": "CK Ng", "active": true, "timeZone": "America/Los_Angeles" }, "body": "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.\r\n\r\nThe same problem persists when using convertPointToView as well.", "updateAuthor": { "name": "ckng", "key": "ckng", "displayName": "CK Ng", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-14T09:19:24.000+0000", "updated": "2012-03-14T09:19:24.000+0000" }, { "id": "199788", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "convert to window co-ordinates\r\n{code}\r\nimage.addEventListener('touchmove', function (e) {\r\n debugLabel.text = \"TOUCHMOVE \"+JSON.stringify(e);\r\n var p = {x:e.x,y:e.y};\r\n var convertPoint = image.convertPointToView(p,window);\r\n image.center = convertPoint;\r\n});\r\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-06-22T12:57:03.000+0000", "updated": "2012-06-22T12:57:03.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }