This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit dc531d7e61eaa1d7d43dd452ec29f58bb10008a5
Author: Alex Harui <[email protected]>
AuthorDate: Mon Aug 6 16:41:53 2018 -0700

    handle initial sizing
---
 .../src/main/royale/mx/managers/SystemManager.as   | 24 +++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
index f06a06a..dfc2d2a 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
@@ -91,12 +91,14 @@ import mx.utils.LoaderUtil;
 use namespace mx_internal;
 */
 
+import org.apache.royale.geom.Rectangle;
+
 import mx.core.IChildList;
 import mx.core.IFlexDisplayObject;
 import mx.core.IUIComponent;
 
 import org.apache.royale.core.IUIBase;
-import org.apache.royale.events.IEventDispatcher;
+import org.apache.royale.events.IEventDispatcher;
 
 //--------------------------------------
 //  Events
@@ -1327,8 +1329,9 @@ public class SystemManager extends SystemManagerBase 
implements ISystemManager,
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.4
      */
-    /* public function get screen():Rectangle
+    public function get screen():Rectangle
     {
+        /* Flex code (why so complicated?)
         if (!_screen)
             Stage_resizeHandler();
 
@@ -1337,7 +1340,16 @@ public class SystemManager extends SystemManagerBase 
implements ISystemManager,
             Stage_resizeHandler();
         }
         return _screen;
-    } */
+        */
+        COMPILE::SWF
+        {
+            return new Rectangle(0, 0, stage.width, stage.height);
+        }
+        COMPILE::JS
+        {
+            return new Rectangle(0, 0, window.innerWidth, window.innerHeight);
+        }
+    }
 
     //----------------------------------
     //  toolTipChildren
@@ -2903,10 +2915,8 @@ public class SystemManager extends SystemManagerBase 
implements ISystemManager,
         // until preloader?
         component.addEventListener("applicationComplete", 
applicationCompleteHandler);
         addChild(component as IUIComponent);
-        COMPILE::SWF
-        {
-            component.setActualSize(stage.stageWidth, stage.stageHeight);      
      
-        }
+        var screen:Rectangle = this.screen;
+        component.setActualSize(screen.width, screen.height);            
     }
     
     private function applicationCompleteHandler(event:Event):void

Reply via email to