You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "OmPrakash Muppirala (JIRA)" <ji...@apache.org> on 2014/10/07 21:28:34 UTC

[jira] [Resolved] (FLEX-34556) Starting an app in portrait on an iPad results in wrong DPI

     [ https://issues.apache.org/jira/browse/FLEX-34556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

OmPrakash Muppirala resolved FLEX-34556.
----------------------------------------
    Resolution: Fixed

Patch accepted and committed:
http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/74dca41e

Thanks Jorn, for catching and fixing this!

> Starting an app in portrait on an iPad results in wrong DPI
> -----------------------------------------------------------
>
>                 Key: FLEX-34556
>                 URL: https://issues.apache.org/jira/browse/FLEX-34556
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Mobile: MobileApplication, Spark: Application
>    Affects Versions: Apache Flex 4.13.0
>         Environment: iOS 5.1, iOS 7, iOS 8
>            Reporter: Jorn Nolles
>            Assignee: OmPrakash Muppirala
>
> *Reproduction*
> # Create an mobile project.
> # Set the 'applicationDPI' to '160'
> # Add some components
> # Now create a build for iOS
> Start the app on the iPad while holding it in 'landscape' mode:
> Result: all components are of the correct size
> Start the app on the iPad while holding it in 'portrait' mode:
> Result: the components are too small.
> *Problem*
> The mx.core.RuntimeDPIProvider has a bug while attempting to determine teh device width/hight (in function runtimeDPI).
> *Solution*
> Don't use 'stage.fullScreenWidth' but use Capabilities.screenResolutionX.
> {code}
> public function get runtimeDPI():Number
> {
> 	if (Platform.isIOS) // as isIPad returns false in the simulator
> 	{
> 		// The original code uses the stage width/height, which is not always set (if the app is started on an iPad in portrait)
> 		var scX:Number = Capabilities.screenResolutionX;
> 		var scY:Number = Capabilities.screenResolutionY;
> 				
> 		// Use the stage width/height only when debugging, because Capabilities reports the computer resolution
> 		if (Capabilities.isDebugger)
> 		{
> 			var root:DisplayObject = SystemManager.getSWFRoot(this);
> 			if (root && root.stage)
> 			{
> 				scX = root.stage.fullScreenWidth;
> 				scY = root.stage.fullScreenHeight;
> 			}
> 		}
> 				
> 		/*  as of Dec 2013,  iPad (resp. iPad retina) are the only iOS devices to have 1024 (resp. 2048) screen width or height
> 		cf http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density#Apple
> 		* */
> 		if (scX == IPAD_MAX_EXTENT || scY == IPAD_MAX_EXTENT)
> 			return DPIClassification.DPI_160;
> 		else if ((scX == IPAD_RETINA_MAX_EXTENT || scY == IPAD_RETINA_MAX_EXTENT))
> 			return DPIClassification.DPI_320;
> 	}
> 			
> 	return classifyDPI(Capabilities.screenDPI);
> }
> {code}
> *Workaround*
> Create an override on the runtimeDPI() getter...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)