Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25557] Android: View rect x and y are inconsistent

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-02-22T00:25:35.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.1.0
ComponentsAndroid
Labelsrect, view
ReporterGuile
AssigneeGary Mathews
Created2017-11-23T11:04:47.000+0000
Updated2018-02-22T00:26:23.000+0000

Description

Comments

  1. Michael Gangolf 2017-11-23

  2. Guile 2017-11-23

    I know that, and I have to manage the contentOffset in a Scrollview. But this is inconsistent with documentation and is a BC break. Maybe rect could also contain "absolute" x and y (which can be very useful too) ?
  3. Michael Gangolf 2017-11-25

    PR: https://github.com/appcelerator/titanium_mobile/pull/9626 Classic version of the test above:
       var win = Ti.UI.createWindow({
       	backgroundColor: 'gray'
       });
       var vw = Ti.UI.createView({
       	top: 100,
       	left: 100,
       	width: 200,
       	height: 200,
       	backgroundColor: "blue"
       });
       
       var inner = Ti.UI.createView({
       	top: 20,
       	left: 20,
       	width: 30,
       	height: 30,
       	backgroundColor: "yellow"
       });
       
       vw.add(inner);
       
       win.add(vw);
       
       win.addEventListener('click', function(e) {
       	if (OS_IOS) {
       		Ti.API.info('Rect : ' + JSON.stringify({
       			x: e.source.rect.x,
       			y: e.source.rect.y,
       			width: e.source.rect.width,
       			height: e.source.rect.height
       		}));
       	} else {
       		Ti.API.info('Rect : ' + JSON.stringify(e.source.rect));
       	}
       });
       win.open();
       
  4. Gary Mathews 2018-02-09

    master: https://github.com/appcelerator/titanium_mobile/pull/9816
  5. Abir Mukherjee 2018-02-22

    Fix was found in SDK 7.1.0.v20180221140035

JSON Source