{ "id": "121953", "key": "TIMOB-15649", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2018-11-17T01:25:42.000+0000", "created": "2013-11-01T21:06:47.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam" ], "versions": [], "issuelinks": [ { "id": "33027", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "122026", "key": "TIMOB-15650", "fields": { "summary": "iOS: x & y positions of \"touchmove\" event are incorrect and erratic", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56347", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171242", "key": "TIMOB-25839", "fields": { "summary": "TiAPI: Touch event coordinate units do not match between platforms", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56957", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "172523", "key": "TIMOB-26503", "fields": { "summary": "Windows: Touch event coordinate units do not match between platforms", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": null, "updated": "2018-11-17T01:25:42.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nA simple draggable view, using the \"touchmove\" event, results in incorrect or erratic values in the event object x and y positions. When setting the view to the new position, based of the finger movement, it will appear to \"jump\" as the values are not sequential in nature. For example, dragging and item to the right might return x values of 1, 2, 5, 4, 6, 7, 9, 8, 11, 10, etc. C\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project\r\n2. Paste this code into app.js:\r\n{code}\r\nvar index = Ti.UI.createWindow({backgroundColor:'black'});\r\nvar view = Ti.UI.createView({backgroundColor:'white'});\r\nindex.add(view);\r\n\r\nindex.addEventListener('postlayout', onWindowReady);\r\n\r\nvar baseHeight; //Original Height of View\r\nvar baseWidth;// Original Width of View\r\n\r\nvar startX; //1st touch x\r\nvar startY; //1st touch y\r\nvar lastX; //last touch x\r\nvar lastY; //last touch y\r\nvar imageX; //x position of view at start\r\nvar imageY; //y position of view at start\r\n\r\nfunction onViewPinch(e) {\r\n view.height = baseHeight * e.scale;\r\n view.width = baseWidth * e.scale;\r\n}\r\n\r\nfunction onViewTouchStart(e) {\r\n\r\n\tbaseHeight = view.height;\r\n\tbaseWidth = view.width;\r\n\r\n\tvar rect = view.rect;\r\n\timageX = rect.x;\r\n\timageY = rect.y;\r\n\t\r\n\tlastX = startX = e.x;\r\n\tlastY = startY = e.y;\r\n\r\n\tTi.API.log(\"onImageTouchStart => \" + startX + \", \" + startY);\r\n}\r\n\r\nfunction onViewTouchMove(e) {\r\n\tTi.API.log(\"onImageMove Delta Last=> \" + (e.x - lastX) + \", \" + (e.y - lastY));\r\n\tTi.API.log(\"onImageMove E Values => \" + (e.x) + \", \" + (e.y));\r\n\t\r\n\tlastX = e.x;\r\n\tlastY = e.y;\r\n\tvar deltaX = e.x - startX;\r\n\tvar deltaY = e.y - startY;\r\n view.left = imageX + deltaX;\r\n view.top = imageY + deltaY;\r\n}\r\n\r\nfunction onViewTouchEnd(e) {\r\n\tTi.API.log(\"onViewTouchEnd Delta Last=> \" + (e.x - lastX) + \", \" + (e.y - lastY));\r\n\tTi.API.log(\"onViewTouchEnd E Values => \" + (e.x) + \", \" + (e.y));\r\n\tvar deltaX = e.x - startX;\r\n\tvar deltaY = e.y - startY;\r\n view.left = imageX + deltaX;\r\n view.top = imageY + deltaY;\r\n}\r\n\r\nfunction onWindowReady(e) {\r\n\tTi.API.log(\"onWindowReady\");\r\n\tindex.removeEventListener('postlayout', onWindowReady);\r\n\tview.addEventListener('pinch', onViewPinch);\r\n\tview.addEventListener('touchstart', onViewTouchStart);\r\n\tview.addEventListener('touchmove', onViewTouchMove);\r\n\tview.addEventListener('touchend', onViewTouchEnd);\r\n}\r\n\r\nindex.open();\r\n{code}\r\n3. Run into device\r\n4. Go with your finger moving to the upper left corner or the device, or down to the right lower corner. \r\n5. You will see the jumping black square, even if that should happen softly. \r\n\r\n\r\n\r\n ", "attachment": [ { "id": "43616", "filename": "DragProblems.zip", "author": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T22:19:41.000+0000", "size": 10331159, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: x & y positions of \"touchmove\" event are incorrect and erratic", "creator": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti 3.1_X, including 3.1.4\r\nTested Android 4.3 with Nexus 4, Samsung Galaxy S3 and Samsung Note 10.1\r\nTested iOS7, iphone5s.", "comment": { "comments": [ { "id": "277761", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\r\n\r\nplease provide a testcase and logs, then we can reopen this. \r\n\r\nBest,\r\n\r\nMauro ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-01T21:54:14.000+0000", "updated": "2013-11-01T21:54:14.000+0000" }, { "id": "277762", "author": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test project attached. You'll notice the blue square will bounce while dragging. ", "updateAuthor": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T22:19:41.000+0000", "updated": "2013-11-01T22:19:41.000+0000" }, { "id": "277765", "author": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm not sure what I can provide in the way of logs, so please let me know. ", "updateAuthor": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T22:27:08.000+0000", "updated": "2013-11-01T22:27:08.000+0000" }, { "id": "277768", "author": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Produces the same result in baseline emulator (WVGA854), so not a device related issue.", "updateAuthor": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T22:33:38.000+0000", "updated": "2013-11-01T22:33:38.000+0000" }, { "id": "277778", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello,\n\nI see exactly the same results in Android and iOS. \n\nTest case: \n\n{code}\nvar index = Ti.UI.createWindow({backgroundColor:'white'});\nvar view = Ti.UI.createView();\nindex.add(view);\n\nindex.addEventListener('postlayout', onWindowReady);\n\nvar baseHeight; //Original Height of View\nvar baseWidth;// Original Width of View\n\nvar startX; //1st touch x\nvar startY; //1st touch y\nvar lastX; //last touch x\nvar lastY; //last touch y\nvar imageX; //x position of view at start\nvar imageY; //y position of view at start\n\nfunction onViewPinch(e) {\n view.height = baseHeight * e.scale;\n view.width = baseWidth * e.scale;\n}\n\nfunction onViewTouchStart(e) {\n\n\tbaseHeight = view.height;\n\tbaseWidth = view.width;\n\n\tvar rect = view.rect;\n\timageX = rect.x;\n\timageY = rect.y;\n\t\n\tlastX = startX = e.x;\n\tlastY = startY = e.y;\n\n\tTi.API.log(\"onImageTouchStart => \" + startX + \", \" + startY);\n}\n\nfunction onViewTouchMove(e) {\n\tTi.API.log(\"onImageMove Delta Last=> \" + (e.x - lastX) + \", \" + (e.y - lastY));\n\tTi.API.log(\"onImageMove E Values => \" + (e.x) + \", \" + (e.y));\n\t\n\tlastX = e.x;\n\tlastY = e.y;\n\tvar deltaX = e.x - startX;\n\tvar deltaY = e.y - startY;\n view.left = imageX + deltaX;\n view.top = imageY + deltaY;\n}\n\nfunction onViewTouchEnd(e) {\n\tTi.API.log(\"onViewTouchEnd Delta Last=> \" + (e.x - lastX) + \", \" + (e.y - lastY));\n\tTi.API.log(\"onViewTouchEnd E Values => \" + (e.x) + \", \" + (e.y));\n\tvar deltaX = e.x - startX;\n\tvar deltaY = e.y - startY;\n view.left = imageX + deltaX;\n view.top = imageY + deltaY;\n}\n\nfunction onWindowReady(e) {\n\tTi.API.log(\"onWindowReady\");\n\tindex.removeEventListener('postlayout', onWindowReady);\n\tview.addEventListener('pinch', onViewPinch);\n\tview.addEventListener('touchstart', onViewTouchStart);\n\tview.addEventListener('touchmove', onViewTouchMove);\n\tview.addEventListener('touchend', onViewTouchEnd);\n}\n\nindex.open();\n\n\n\n{code}\n\nMy question: what do you expect as output of the testcase? \n\nBest,\n\nMauro", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-01T23:08:52.000+0000", "updated": "2013-11-01T23:08:52.000+0000" }, { "id": "277798", "author": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "body": "A correct result for this test case would be:\n\n1. The rectangle (view, image, other view type) would smoothly follow your finger on the device (or mouse on emulators)\n2. The rectangle would stay in the same position relative to your finger. Currently the rectangle will start to lag increasingly behind where you touch initially. For example, if you start with your finger in the center of the rectangle, the farther you drag, the more the rectangle will not be centered under your finger.\n\nThe trace output, when dragging directly down, produces the results below. The 2nd value (which is event.y), should be linear (or mostly) from 120 to 155. However, you will see as you go down the list, that the value goes up and then back, up then back, up then back. The 1st four values (120, 118, 129, 123) should probably be something more like 120, 121, 122, 123. This is what induces the \"jump\" or \"flicker\" as the element is dragged. \n\nE Values => 191.5156707763672, 120.71463012695312\nE Values => 190.5156707763672, 118.70878601074219 \nE Values => 191.5156707763672, 129.6982421875 \nE Values => 189.51358032226562, 123.69241333007812\nE Values => 190.51148986816406, 134.68655395507812\nE Values => 190.51148986816406, 136.6842041015625\nE Values => 189.51148986816406, 130.67837524414062\nE Values => 188.5093994140625, 134.67135620117188\nE Values => 188.50730895996094, 144.66668701171875\nE Values => 189.50730895996094, 145.66082763671875\nE Values => 188.50523376464844, 140.65496826171875\nE Values => 186.50314331054688, 144.64913940429688\nE Values => 187.50314331054688, 152.6456298828125\nE Values => 190.50314331054688, 151.64212036132812\nE Values => 189.50314331054688, 145.6397705078125\n", "updateAuthor": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-01T23:56:43.000+0000", "updated": "2013-11-01T23:56:43.000+0000" }, { "id": "277954", "author": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I just checked MobileWeb and the problem exists there also.\r\n\r\nOverall, it seems like the issue is how global coordinates are converted to local coordinates. I'm searching through the mobileweb code to see if I can determine where this is happening. Perhaps this will shed some light on why it happening in iOS and Android as well.", "updateAuthor": { "name": "andrew@gstreetmedia.com", "key": "andrew@gstreetmedia.com", "displayName": "Andrew Greenstreet", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-04T15:25:38.000+0000", "updated": "2013-11-04T17:35:09.000+0000" }, { "id": "277982", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Got a test case clearly showing the issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-04T17:40:23.000+0000", "updated": "2013-11-04T17:40:23.000+0000" }, { "id": "443715", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue will be resolved by: [TIMOB-25839]", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-17T01:25:36.000+0000", "updated": "2018-11-17T01:25:36.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }