[TIMOB-4859] Allow conversion of globalPoints to rotation-based values
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2011-08-26T11:57:39.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | n/a |
Components | iOS |
Labels | feature, ios |
Reporter | Matthew Congrove |
Assignee | Reggie Seagraves |
Created | 2011-08-01T10:45:36.000+0000 |
Updated | 2017-03-09T23:09:45.000+0000 |
Description
The globalPoint coordinates returned from touch events on an element do not update once the device is rotated; when in portrait mode the X coordinate will increase as you touch from left-to-right, but if you switch to landscape mode the X coordinate becomes the Y coordinate, and vice versa. Sample code below; to reproduce, start in portrait mode and drag left to right (X coordinate increases as expected)... then flip into landscape and drag from left to right; X coordinate does not change as expected.
var win = Ti.UI.createWindow();
var view = Ti.UI.createView();
var output = Ti.UI.createLabel({
top: 20,
left: 20,
width: 280,
color: "#FFF",
textAlign: "center",
font: {
fontSize: 16,
fontWeight: "bold"
},
text: "Touch and drag anywhere"
});
view.addEventListener("touchmove", function(_event) {
output.text = "X Global Point: " + _event.globalPoint.x;
});
view.add(output);
win.add(view);
win.open();
Originally reported as a bug, but was invalidated as globalPoint is attached at the device level, not window level. Changed from bug to feature request as per TIMOB-4695. Request is to allow translation from device level to window level.
globalpoint is being deprecated. Please see linked item for customer solution.
Closing ticket as the issue will not fix.