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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 4996a7e  handle left/right and top/bottom sizing
4996a7e is described below

commit 4996a7ed534f5738e802326db228dd24544c6d0f
Author: Alex Harui <aha...@apache.org>
AuthorDate: Thu Aug 15 00:43:10 2019 -0700

    handle left/right and top/bottom sizing
---
 .../MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as  | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
index 3fc8b87..36821e1 100644
--- 
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as
@@ -26,6 +26,7 @@ package mx.containers.beads
        import mx.core.Container;
        import mx.core.EdgeMetrics;
        import mx.core.IUIComponent;
+    import mx.core.UIComponent;
        
     import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
        import org.apache.royale.core.IStrand;
@@ -267,6 +268,7 @@ package mx.containers.beads
                                // vertical layout.
                                
                                var child:IUIComponent = 
layoutView.getElementAt(0) as IUIComponent;
+                var uic:UIComponent = child as UIComponent;
                                
                                var percentWidth:Number = child.percentWidth;
                                var percentHeight:Number = child.percentHeight;
@@ -278,6 +280,10 @@ package mx.containers.beads
                                                Math.min(child.maxWidth,
                                                        ((percentWidth >= 100) 
? w : (w * percentWidth / 100))));
                                }
+                else if (uic != null && !isNaN(Number(uic.left)) && 
!isNaN(Number(uic.right)))
+                {
+                    width = w - Number(uic.left) - Number(uic.right);
+                }
                                else
                                {
                                        width = 
child.getExplicitOrMeasuredWidth();
@@ -290,6 +296,10 @@ package mx.containers.beads
                                                Math.min(child.maxHeight,
                                                        ((percentHeight >= 100) 
? h : (h * percentHeight / 100))));
                                }
+                else if (uic != null && !isNaN(Number(uic.top)) && 
!isNaN(Number(uic.bottom)))
+                {
+                    height = h - Number(uic.top) - Number(uic.bottom);
+                }
                                else
                                {
                                        height = 
child.getExplicitOrMeasuredHeight();

Reply via email to