[TIMOB-8421] MobileWeb: Sizes in millimeters interpreted incorrectly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-14T13:51:04.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.1.0, Sprint 2012-12 MW |
Components | MobileWeb |
Labels | parity, qe-port |
Reporter | Arthur Evans |
Assignee | Bryan Hughes |
Created | 2012-03-29T13:13:32.000+0000 |
Updated | 2012-08-08T16:24:39.000+0000 |
Description
When adding a view with a size specified in points (mm), the view is sized in centimeters, instead.
In the following code sample, the blue and red boxes should be the same size, as on iOS. See attached screenshots.
var win1 = Titanium.UI.createWindow({
title:'Composite Layout Test',
backgroundColor:'#fff',
layout: 'vertical'
});
var l1 = Titanium.UI.createLabel({
top: 0,
color:'#999',
backgroundColor: 'blue',
text:'1in',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'1in',
height:'1in'
});
win1.add(l1);
var l2 = Titanium.UI.createLabel({
top: 0,
color:'#999',
backgroundColor: 'red',
text:'72pt',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
// this should be 1 inch
width:'25.4mm',
height:'25.4mm'
});
win1.add(l2);
var l3 = Titanium.UI.createLabel({
top: 0,
color:'#999',
backgroundColor: 'green',
text:'72 units',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:72,
height:72
});
win1.add(l3);
win1.open();
Attachments
File | Date | Size |
---|---|---|
app.js | 2012-06-12T17:09:40.000+0000 | 3668 |
ios_layout_mm.png | 2012-03-29T13:19:34.000+0000 | 10810 |
mobileweb_mm.png | 2012-03-29T13:19:34.000+0000 | 25584 |
Also, centimeters appears to be unimplemented. According to the spec this should work.
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2380
BTW, it's worth noting that most browsers use 96DPI, not 72, so you're comparisons above don't all work.
Tested On: Titanium studio : 2.1.1.201207271312 SDK version : 2.0.3.v20120806151610 Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 5.1.4,firefox 14.0.1