You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/05/23 07:16:21 UTC

[13/13] git commit: [flex-asjs] [refs/heads/release0.8.0] - overflow layouts should watch parent container for changes. In overflow layouts the parent may not ask the child to re-layout since the child's size may not change since we set it to cause over

overflow layouts should watch parent container for changes.  In overflow layouts the parent may not ask the child to re-layout since the child's size may not change since we set it to cause overflow


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

Branch: refs/heads/release0.8.0
Commit: 1e450bb751e1dad52605a10909e0954a20ffb565
Parents: f05a94f
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 23 00:15:48 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 23 00:15:57 2017 -0700

----------------------------------------------------------------------
 ...eFlexibleChildHorizontalLayoutForOverflow.as | 19 ++++++++++++++++++-
 ...OneFlexibleChildVerticalLayoutForOverflow.as | 20 +++++++++++++++++++-
 2 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e450bb7/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
index c6abc22..027f2ee 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
@@ -30,6 +30,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.CSSContainerUtils;
 	import org.apache.flex.utils.CSSUtils;
@@ -64,7 +65,23 @@ package org.apache.flex.html.beads.layouts
 		{
 			super();
 		}
+		
+        /**
+         *  @flexjsignorecoercion org.apache.flex.events.IEventDispatcher;
+         */
+		COMPILE::JS
+		override public function set strand(value:IStrand):void
+		{
+			super.strand = value;
+			(host.parent as IEventDispatcher).addEventListener("sizeChanged", parentSizeChangedHandler);
+		}
 
+		COMPILE::JS
+		private function parentSizeChangedHandler(event:Event):void
+		{
+			performLayout();	
+		}
+		
         private var _flexibleChild:String;
 
         protected var actualChild:ILayoutChild;
@@ -115,7 +132,7 @@ package org.apache.flex.html.beads.layouts
 					child.element.style["display"] = "inline-block";
 			}
 
-			var w:Number = host.width;
+			var w:Number = host.width - 1;
 			for(i=0; i < n; i++) {
 				child = contentView.getElementAt(i) as UIBase;
 				if (child != actualChild)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e450bb7/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
index 5679f80..f9f0b1d 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
@@ -31,6 +31,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.CSSContainerUtils;
 	import org.apache.flex.utils.CSSUtils;
@@ -66,6 +67,23 @@ package org.apache.flex.html.beads.layouts
 			super();
 		}
 
+	
+        /**
+         *  @flexjsignorecoercion org.apache.flex.events.IEventDispatcher;
+         */
+		COMPILE::JS
+		override public function set strand(value:IStrand):void
+		{
+			super.strand = value;
+			(host.parent as IEventDispatcher).addEventListener("sizeChanged", parentSizeChangedHandler);
+		}
+
+		COMPILE::JS
+		private function parentSizeChangedHandler(event:Event):void
+		{
+			performLayout();	
+		}
+
         private var _flexibleChild:String;
 
         protected var actualChild:ILayoutChild;
@@ -116,7 +134,7 @@ package org.apache.flex.html.beads.layouts
 					child.element.style["display"] = "block";
 			}
 
-			var h:Number = host.height;
+			var h:Number = host.height - 1;
 			for(i=0; i < n; i++) {
 				child = contentView.getElementAt(i) as UIBase;
 				if (child != actualChild)