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:10 UTC

[02/13] git commit: [flex-asjs] [refs/heads/release0.8.0] - force childResizeHandlers to run in parent if our size changes during layout

force childResizeHandlers to run in parent if our size changes during layout


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

Branch: refs/heads/release0.8.0
Commit: 4713ffd4728fca1feec86368033e9a0cee33780e
Parents: 0cbb478
Author: Alex Harui <ah...@apache.org>
Authored: Sun May 21 23:24:12 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 23 00:15:55 2017 -0700

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/core/LayoutBase.as      | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4713ffd4/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
index dd0cdee..5241bed 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/LayoutBase.as
@@ -283,6 +283,9 @@ package org.apache.flex.core
 			if (isLayoutRunning) return;
 			
 			isLayoutRunning = true;
+
+			var oldWidth:Number = host.width;
+			var oldHeight:Number = host.height;
 			
 			var viewBead:ILayoutHost = (host as ILayoutParent).getLayoutHost();
 			
@@ -295,6 +298,13 @@ package org.apache.flex.core
 			isLayoutRunning = false;
 			
 			IEventDispatcher(host).dispatchEvent(new Event("layoutComplete"));
+			
+			// check sizes to see if layout changed the size or not
+			// and send an event to re-layout parent of host
+			if (host.width != oldWidth ||
+			    host.height != oldHeight)
+				host.dispatchEvent(new Event("sizeChanged"));
+
 		}
 
         /**