tweak when we complete setup right away. Some containers also have left/right constraint pairs
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8165b5c4 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8165b5c4 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8165b5c4 Branch: refs/heads/develop Commit: 8165b5c4d196835df3805ca05c33f4664e495fa9 Parents: c5fb1c5 Author: Alex Harui <[email protected]> Authored: Sat Aug 1 00:10:34 2015 -0700 Committer: Alex Harui <[email protected]> Committed: Sat Aug 1 00:10:56 2015 -0700 ---------------------------------------------------------------------- .../as/src/org/apache/flex/html/beads/ContainerView.as | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8165b5c4/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as index 4785ed3..ba61bb3 100644 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as +++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as @@ -26,6 +26,7 @@ package org.apache.flex.html.beads import org.apache.flex.core.IBeadLayout; import org.apache.flex.core.IBeadView; import org.apache.flex.core.IContainer; + import org.apache.flex.core.ILayoutChild; import org.apache.flex.core.ILayoutParent; import org.apache.flex.core.IParentIUIBase; import org.apache.flex.core.IStrand; @@ -155,15 +156,18 @@ package org.apache.flex.html.beads */ protected function initCompleteHandler(event:Event):void { - // if the host component is not being sized by percentage, go ahead and complete the setup. - if (isNaN((host as UIBase).percentHeight) && isNaN((host as UIBase).percentWidth)) { + var ilc:ILayoutChild = host as ILayoutChild; + // Complete the setup if the height is sized to content or has been explicitly set + // and the width is sized to content or has been explicitly set + if ((ilc.isHeightSizedToContent() || !isNaN(ilc.explicitHeight)) && + (ilc.isWidthSizedToContent() || !isNaN(ilc.explicitWidth))) { completeSetup(); var num:Number = contentView.numElements; if (num > 0) performLayout(event); } else { - // otherwise, wait until the size has been set and then finish + // otherwise, wait until the unknown sizes hav been set and then finish host.addEventListener("sizeChanged", deferredSizeHandler); } }
