{ "id": "137042", "key": "AC-774", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-09-17T06:53:43.000+0000", "created": "2014-09-23T18:34:06.000+0000", "labels": [ "android", "drag", "ios", "slide" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:02.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14551", "name": "Studio", "description": "Please enter tickets related to Titanium Studio here." } ], "description": "When I'm trying to get the slided coordinates, if I start the touch in another view it gets its positions instead the requested one.\r\n\r\nSee the exemple, start sliding in the red or blue box, and see the console logs.", "attachment": [ { "id": "51574", "filename": "touch_e.png", "author": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2014-09-24T13:51:28.000+0000", "size": 16209, "mimeType": "image/png" }, { "id": "51528", "filename": "touchmove.bug.exemple.zip", "author": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2014-09-23T18:34:06.000+0000", "size": 3369788, "mimeType": "application/zip" } ], "flagged": false, "summary": "get screen coordinates - convertPointToView - not requested view", "creator": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "subtasks": [], "reporter": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "environment": "Mac OS X 10.9.4, Titanium Studio: 3.3.0.201407100905, Alloy 1.4.0, iOS iPad simulator 7.1, BQ Edison 2 3G and BQ Edison 3 with Android 4.4", "comment": { "comments": [ { "id": "325412", "author": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "body": "I've figured out:\r\n\r\nvar real_screen_coords = {\r\n x:0,\r\n y:0\r\n};\r\n\r\napp_window.addEventListener(\"touchmove\",function(e) {\r\n\r\n real_screen_coords = e.source.convertPointToView({\r\n x : e.x,\r\n y : e.y\r\n }, app_window);\r\n});", "updateAuthor": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2014-09-24T10:35:45.000+0000", "updated": "2014-09-24T10:35:45.000+0000" }, { "id": "325417", "author": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "body": "I am trying to get the coordinates of the main window using touchstart event:\r\n\r\nwin.addEventListener(\"touchstart\", function(e) {\r\n \r\n console.log(e.x);\r\n});\r\n\r\nBut if i'm touching a view or label inside the window, it gives the views/labels coordinates, how can I bypass that, in order to get only the main window coordinates?", "updateAuthor": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2014-09-24T13:50:58.000+0000", "updated": "2014-09-24T13:50:58.000+0000" }, { "id": "325418", "author": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "body": "touch events logs", "updateAuthor": { "name": "ricardo_jcp", "key": "ricardo_jcp", "displayName": "Ricardo Pereira", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2014-09-24T13:51:28.000+0000", "updated": "2014-09-24T13:51:28.000+0000" }, { "id": "362431", "author": { "name": "pchowdhury", "key": "pchowdhury", "displayName": "Papia Chowdhury", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello,\r\n\r\nWe tested this issue and found out that the convertPointToView works as expected. Please check out the sample we tested here and let us know if you notice otherwise.\r\n\r\n*Testing Environment:*\r\n\r\nAppcelerator Studio, build: 4.2.0.201508141038\r\nTitanium SDK: 4.1.0 GA\r\niOS simulator: iphone 5s(v8.1)\r\nOS X version: 10.9.5\r\n\r\n*Steps to Test:*\r\n1. Create a classic project\r\n2. Copy below code and run the app\r\n\r\nNow, click on any point and observe that the x and y coordinate of main window shown in the log.\r\n\r\n*Test Case:*\r\napp.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'black'\r\n});\r\nvar center1 = {\r\n\t'x' : 100,\r\n\t'y' : 100\r\n};\r\nvar center2 = {\r\n\t'x' : 100,\r\n\t'y' : 250\r\n};\r\nvar lastIndex = 1;\r\nvar background = Ti.UI.createView({\r\n\tbackgroundColor : \"#444444\",\r\n});\r\nvar view = Ti.UI.createView({\r\n\tbackgroundColor : 'red',\r\n\tcenter : center1,\r\n\twidth : 100,\r\n\theight : 100,\r\n\tzIndex : lastIndex++,\r\n});\r\nvar view2 = Ti.UI.createView({\r\n\tbackgroundColor : 'green',\r\n\tcenter : center2,\r\n\twidth : 100,\r\n\theight : 100,\r\n\tzIndex : lastIndex,\r\n});\r\nbackground.addEventListener('touchstart', function(e) {\r\n\tvar bgPoint = background.convertPointToView(e, background);\r\n\tTi.API.info(\"Background Point: \" + bgPoint.x + \",\" + bgPoint.y);\r\n\tview.center = bgPoint;\r\n\tview.backgroundColor = 'blue';\r\n});\r\n\r\nview.addEventListener('touchend', function(e) {\r\n\tview.center = center1;\r\n\tview.backgroundColor = 'red';\r\n});\r\nwin.add(background);\r\nwin.add(view);\r\nwin.add(view2);\r\nwin.open(); \r\n{code}\r\n\r\nThanks.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-07T09:56:02.000+0000", "updated": "2015-09-17T06:53:35.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }