[TIMOB-24825] Windows: Ti.UI.View.center is incorrectly calculated
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-17T17:22:23.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | Release 6.2.0 |
Components | Windows |
Labels | n/a |
Reporter | Gary Mathews |
Assignee | Kota Iguchi |
Created | 2017-06-15T01:24:43.000+0000 |
Updated | 2017-08-18T17:50:10.000+0000 |
Description
- The
center
property of View
is incorrectly calculated, producing invalid positioning.
var window = Ti.UI.createWindow({backgroundColor: 'gray'}),
a = Ti.UI.createView({backgroundColor: 'red', width: 200, height: 200, top: 0, left: 0}),
b = Ti.UI.createView({backgroundColor: 'blue', width: 100, height: 100, center: {x: 150, y: 150}}),
btn_a = Ti.UI.createButton({title: 'TOP LEFT', bottom: 0, left: 0, width: '50%'}),
btn_b = Ti.UI.createButton({title: 'ZERO', bottom: 0, right: 0, width: '50%'});
btn_a.addEventListener('click', function(){
b.center = {x: '50%', y: '50%'};
});
window.add([btn_a, a, b]);
window.open();
Expected:
The "center" property is supposed to be relative to the parent's top-left corner.
https://github.com/appcelerator/titanium_mobile_windows/pull/1022
https://github.com/appcelerator/titanium_mobile_windows/pull/1064
[~kiguchi] Master is merged waiting for 6_2_X:
Verified fix in SDK Version 7.0.0.v20170818091652 and SDK Version: 6.2.0.v20170816173122 Test and other information can be found at: Master: https://github.com/appcelerator/titanium_mobile_windows/pull/1064 6_2_X: https://github.com/appcelerator/titanium_mobile_windows/pull/1069