Titanium JIRA Archive
Appcelerator Community (AC)

[AC-388] convertUnits iphone 6 plus calculates wrong pixel size from dips

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2015-11-21T19:12:55.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios, iphone
ReporterMichel van Gooswilligen
AssigneeRadamantis Torres-Lechuga
Created2014-11-27T09:44:20.000+0000
Updated2015-11-21T19:12:55.000+0000

Description

looking at the code from UIModule (ios) for the convertToUnits method:
 if ([TiUtils isRetinaDisplay]) {
result = fromVal.value*2;
}
else {
result = fromVal.value;
}
Which does not take into account the new "hdd retina"

Comments

  1. Sharif AbuDarda 2015-11-11

    This is in Ti SDK [core code](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/UIModule.m). According to the documentation [link](http://docs.appcelerator.com/platform/latest/#!/guide/Layouts,_Positioning,_and_the_View_Hierarchy) iPhone with either original or retina display is based on a 320 x 480 dip grid. Where 1dip=2px on retina. But what about for HD retina display like iPhone6 or iPhone6Plus. So issue is in core code. Where it's only counted the retina display and calculate the conversion to pixels according to documentation ( as two times ). But for iPhone6 and iPhone6 Plus display it's not true. You can get the dpi value for any device by
       Ti.API.info('Ti.Platform.displayCaps.dpi: ' + Ti.Platform.displayCaps.dpi);
       
    iPhone 6 plus device is not available here, So we can't test the issue. Thanks.

JSON Source