Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DA3F117AB9 for ; Tue, 7 Oct 2014 19:26:49 +0000 (UTC) Received: (qmail 60501 invoked by uid 500); 7 Oct 2014 19:26:48 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 60355 invoked by uid 500); 7 Oct 2014 19:26:48 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 60277 invoked by uid 99); 7 Oct 2014 19:26:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2014 19:26:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7EFD9903CB7; Tue, 7 Oct 2014 19:26:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bigosmallm@apache.org To: commits@flex.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: [flex-sdk] [refs/heads/develop] - Fix for https://issues.apache.org/jira/browse/FLEX-34556 (thanks to Jorn Nolles) Date: Tue, 7 Oct 2014 19:26:48 +0000 (UTC) Repository: flex-sdk Updated Branches: refs/heads/develop e72f72e3a -> 74dca41e0 Fix for https://issues.apache.org/jira/browse/FLEX-34556 (thanks to Jorn Nolles) Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/74dca41e Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/74dca41e Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/74dca41e Branch: refs/heads/develop Commit: 74dca41e004668f1914b1dc494a9d454f7205e61 Parents: e72f72e Author: OmPrakash Muppirala Authored: Tue Oct 7 12:26:03 2014 -0700 Committer: OmPrakash Muppirala Committed: Tue Oct 7 12:26:03 2014 -0700 ---------------------------------------------------------------------- .../framework/src/mx/core/RuntimeDPIProvider.as | 51 +++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/74dca41e/frameworks/projects/framework/src/mx/core/RuntimeDPIProvider.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/core/RuntimeDPIProvider.as b/frameworks/projects/framework/src/mx/core/RuntimeDPIProvider.as index 7ce8cc7..7d82fb8 100644 --- a/frameworks/projects/framework/src/mx/core/RuntimeDPIProvider.as +++ b/frameworks/projects/framework/src/mx/core/RuntimeDPIProvider.as @@ -118,31 +118,34 @@ public class RuntimeDPIProvider */ public function get runtimeDPI():Number - { - var isIOS:Boolean = Platform.isIOS; - var screenDPI:Number = Capabilities.screenDPI; - - if (isIOS) // as isIPad returns false in the simulator + { + if (Platform.isIOS) // as isIPad returns false in the simulator { - var root:DisplayObject = SystemManager.getSWFRoot(this); - if (root != null ) { - var stage:Stage = root.stage; - if (stage != null){ - var scX:Number = stage.fullScreenWidth; - var scY:Number = 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_RETINA_MAX_EXTENT || scY == IPAD_RETINA_MAX_EXTENT)) - return DPIClassification.DPI_320; - else if (scX == IPAD_MAX_EXTENT || scY == IPAD_MAX_EXTENT) - return DPIClassification.DPI_160; - } - } - } - - return classifyDPI(screenDPI); - } + 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); + } /** * @private