can't use % to find child because % messes up html side
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7fa32aeb Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7fa32aeb Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7fa32aeb Branch: refs/heads/develop Commit: 7fa32aeb6f70f5dd618e49df91329cbdb530e187 Parents: c6a8107 Author: Alex Harui <aha...@apache.org> Authored: Tue Jan 13 10:01:32 2015 -0800 Committer: Alex Harui <aha...@apache.org> Committed: Tue Jan 13 10:01:32 2015 -0800 ---------------------------------------------------------------------- .../layouts/OneFlexibleChildVerticalLayout.as | 22 +++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7fa32aeb/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as index cee8cad..50c1d81 100644 --- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as +++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as @@ -56,6 +56,17 @@ package org.apache.flex.html.beads.layouts { } + + /** + * The flexible child + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public var flexibleChild:IUIBase; + // the strand/host container is also an ILayoutChild because // can have its size dictated by the host's parent which is // important to know for layout optimization @@ -136,7 +147,7 @@ package org.apache.flex.html.beads.layouts for (var i:int = 0; i < n; i++) { var child:IUIBase = contentView.getElementAt(i) as IUIBase; - if (child is ILayoutChild && !isNaN(ILayoutChild(child).percentHeight)) + if (child == flexibleChild) { flexChildIndex = i; break; @@ -207,7 +218,7 @@ package org.apache.flex.html.beads.layouts horizontalMargins[i] = { marginLeft: ml, marginRight: mr, halign: halign }; } - for (i = n - 1; i >= flexChildIndex; i--) + for (i = n - 1; i > flexChildIndex; i--) { child = contentView.getElementAt(i) as IUIBase; margin = ValuesManager.valuesImpl.getValue(child, "margin"); @@ -404,7 +415,12 @@ package org.apache.flex.html.beads.layouts var pl:Number = Number(paddingLeft); var pt:Number = Number(paddingTop); var pr:Number = Number(paddingRight); - + if (isNaN(pl)) + pl = 0; + if (isNaN(pr)) + pr = 0; + if (isNaN(pt)) + pt = 0; return {paddingLeft:pl, paddingTop:pt, paddingRight:pr}; }