[AC-774] get screen coordinates - convertPointToView - not requested view
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2015-09-17T06:53:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio |
Labels | android, drag, ios, slide |
Reporter | Ricardo Pereira |
Assignee | Shak Hossain |
Created | 2014-09-23T18:34:06.000+0000 |
Updated | 2016-03-08T07:37:02.000+0000 |
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.
See the exemple, start sliding in the red or blue box, and see the console logs.
Attachments
I've figured out: var real_screen_coords = { x:0, y:0 }; app_window.addEventListener("touchmove",function(e) { real_screen_coords = e.source.convertPointToView({ x : e.x, y : e.y }, app_window); });
I am trying to get the coordinates of the main window using touchstart event: win.addEventListener("touchstart", function(e) { console.log(e.x); }); But 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?
touch events logs
Hello, We 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. *Testing Environment:* Appcelerator Studio, build: 4.2.0.201508141038 Titanium SDK: 4.1.0 GA iOS simulator: iphone 5s(v8.1) OS X version: 10.9.5 *Steps to Test:* 1. Create a classic project 2. Copy below code and run the app Now, click on any point and observe that the x and y coordinate of main window shown in the log. *Test Case:* app.js
Thanks.