Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4859] Allow conversion of globalPoints to rotation-based values

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2011-08-26T11:57:39.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsiOS
Labelsfeature, ios
ReporterMatthew Congrove
AssigneeReggie Seagraves
Created2011-08-01T10:45:36.000+0000
Updated2017-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.

Comments

  1. Reggie Seagraves 2011-08-26

    globalpoint is being deprecated. Please see linked item for customer solution.
  2. Lee Morris 2017-03-09

    Closing ticket as the issue will not fix.

JSON Source