You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2015/04/28 22:04:18 UTC

git commit: [flex-asjs] [refs/heads/develop] - Added a listener for sizeChanged event in FlexibleFirstChildHorizontalLayout so it would pick up event dispatched by its container when the container was given its final size. Added a scrolling rect to the A

Repository: flex-asjs
Updated Branches:
  refs/heads/develop ba7a0f883 -> 254b5e955


Added a listener for sizeChanged event in FlexibleFirstChildHorizontalLayout so it would pick up event dispatched by its container when the container was given its final size. Added a scrolling rect to the AS side of BasicScrollingLayout to clip the contents of the scrollable area.


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

Branch: refs/heads/develop
Commit: 254b5e95503d4763747ca35529446b586bebb463
Parents: ba7a0f8
Author: Peter Ent <pe...@apache.org>
Authored: Tue Apr 28 16:04:15 2015 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Tue Apr 28 16:04:15 2015 -0400

----------------------------------------------------------------------
 .../html/beads/layouts/BasicScrollingLayout.as     |  1 +
 .../layouts/FlexibleFirstChildHorizontalLayout.as  | 17 +++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/254b5e95/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicScrollingLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicScrollingLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicScrollingLayout.as
index de7ee78..e9ef9ef 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicScrollingLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicScrollingLayout.as
@@ -120,6 +120,7 @@ package org.apache.flex.html.beads.layouts
             }
             contentView.x = (border) ? borderModel.offsets.left : 0;
             contentView.y = (border) ? borderModel.offsets.top : 0;
+			DisplayObject(contentView).scrollRect = new Rectangle(0,0,contentView.width,contentView.height);
             
             var w:Number = contentView.width;
             var h:Number = contentView.height;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/254b5e95/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
index 23d2a9d..a48cd63 100644
--- a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
@@ -20,9 +20,9 @@ package org.apache.flex.html.beads.layouts
 {
 	import org.apache.flex.core.IBeadLayout;
 	import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.IParent;
 	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IParent;
-    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
@@ -72,6 +72,7 @@ package org.apache.flex.html.beads.layouts
 			IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
 			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
 			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
+			IEventDispatcher(value).addEventListener("sizeChanged", changeHandler);
 		}
 	
 		private function changeHandler(event:Event):void
@@ -89,7 +90,7 @@ package org.apache.flex.html.beads.layouts
 			var verticalMargins:Array = [];
 			
             var xx:Number = layoutParent.resizableView.width;
-            if (isNaN(xx))
+            if (isNaN(xx) || xx <= 0)
                 return;
             var padding:Object = determinePadding();
             // some browsers don't like it when you go all the way to the right edge.
@@ -155,15 +156,15 @@ package org.apache.flex.html.beads.layouts
 						mr = 0;
 				}
 				child.y = mt;
-				maxHeight = Math.max(maxHeight, mt + child.height + mb);
+				maxHeight = Math.max(maxHeight, mt + child.clientHeight + mb);
 				if (i == 0)
                 {
                     child.x = ml;
                     child.width = xx - mr;
                 }
 				else
-                    child.x = xx - child.width - mr;
-				xx -= child.width + mr + ml;
+                    child.x = xx - child.clientWidth - mr;
+				xx -= child.clientWidth + mr + ml;
 				lastmr = mr;
 				var valign:Object = ValuesManager.valuesImpl.getValue(child, "vertical-align");
 				verticalMargins.push({ marginTop: mt, marginBottom: mb, valign: valign });
@@ -173,9 +174,9 @@ package org.apache.flex.html.beads.layouts
 				var obj:Object = verticalMargins[0]
 				child = contentView.getElementAt(i) as IUIBase;
 				if (obj.valign == "middle")
-					child.y = (maxHeight - child.height) / 2;
+					child.y = (maxHeight - child.clientHeight) / 2;
 				else if (valign == "bottom")
-					child.y = maxHeight - child.height - obj.marginBottom;
+					child.y = maxHeight - child.clientHeight - obj.marginBottom;
 				else
 					child.y = obj.marginTop;
 			}