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 106f3c319f32c39e9f02215cef5d77f8de34c8c0
Author: Alex Harui <[email protected]>
AuthorDate: Tue Aug 14 11:55:29 2018 -0700

    try to reduce number of calls to layout
---
 .../Basic/src/main/royale/org/apache/royale/core/LayoutBase.as     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/LayoutBase.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/LayoutBase.as
index d38fedf..edc5e47 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/LayoutBase.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/LayoutBase.as
@@ -95,6 +95,9 @@ package org.apache.royale.core
 
                }
                
+        private var lastWidth:Number = -1;
+        private var lastHeight:Number = -1;
+        
                /**
                 * Changes in size to the host strand are handled (by default) 
by running the
                 * layout sequence. Subclasses can override this function and 
use event.type
@@ -107,7 +110,11 @@ package org.apache.royale.core
                 */
                protected function handleSizeChange(event:Event):void
                {
+            if (host.width == lastWidth &&
+                host.height == lastHeight) return;
                        performLayout();
+            lastWidth = host.width;
+            lastHeight = host.height;
                }
                
                /**

Reply via email to