try to be smarter about when to layout.  FlexJSStore Panel TitleBar wasn't 
laying out at the right size because it would get a childResize when it was at 
is natural size, start laying out at that natural size, then the parent Panel 
would try to layout TitleBar at correct width in response to Titlebar layout 
but it was blocked since TitleBar was already in layout at the wrong size


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/40bdebae
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/40bdebae
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/40bdebae

Branch: refs/heads/tlf
Commit: 40bdebae2d1003b71ace3d64770832a82f58bf4a
Parents: f81ae0b
Author: Alex Harui <aha...@apache.org>
Authored: Thu Jun 8 09:35:38 2017 -0700
Committer: Alex Harui <aha...@apache.org>
Committed: Thu Jun 8 10:20:57 2017 -0700

----------------------------------------------------------------------
 .../flex/org/apache/flex/core/LayoutBase.as     | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/40bdebae/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as 
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
index 859add9..d575ee5 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
@@ -151,6 +151,42 @@ package org.apache.flex.core
                 */
                protected function childResizeHandler(event:Event):void
                {
+                       var viewBead:ILayoutHost;
+                       
+                       // don't layout in response to child size changes if 
sized by parent
+                       // or explicitly sized
+                       if (event.type == "widthChanged" && 
+                               !(host.isWidthSizedToContent() || 
!isNaN(host.explicitWidth)))
+                       {
+                               // but do call this to update scrolling 
viewports
+                               viewBead = (host as 
ILayoutParent).getLayoutHost();
+                               viewBead.beforeLayout();
+                               viewBead.afterLayout();
+                               return;
+                       }
+                       // don't layout in response to child size changes if 
sized by parent
+                       // or explicitly sized
+                       if (event.type == "heightChanged" && 
+                               !(host.isHeightSizedToContent() || 
!isNaN(host.explicitHeight)))
+                       {
+                               // but do call this to update scrolling 
viewports
+                               viewBead = (host as 
ILayoutParent).getLayoutHost();
+                               viewBead.beforeLayout();
+                               viewBead.afterLayout();
+                               return;
+                       }
+                       // don't layout in response to child size changes if 
sized by parent
+                       // or explicitly sized
+                       if (event.type == "sizeChanged" && 
+                               !(host.isHeightSizedToContent() || 
!isNaN(host.explicitHeight)) &&
+                               !(host.isWidthSizedToContent() || 
!isNaN(host.explicitWidth)))
+                       {
+                               // but do call this to update scrolling 
viewports
+                               viewBead = (host as 
ILayoutParent).getLayoutHost();
+                               viewBead.beforeLayout();
+                               viewBead.afterLayout();
+                               return;
+                       }
                        performLayout();
                }
                

Reply via email to