You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2020/12/16 07:14:00 UTC

[royale-asjs] 02/02: invalidateSize if children are growing during layout. It means that a child that was sizedToContent was re-measured or otherwise got a new size so the parent's size is invalid unless both explicitly set. Even for percentage sizing the min size of the parent depends on the children's size

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

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

commit 578764997cbe51f505ff30b871cbf0282c0467a6
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Dec 15 23:13:36 2020 -0800

    invalidateSize if children are growing during layout.  It means that a child that was sizedToContent was re-measured or otherwise got a new size so the parent's size is invalid unless both explicitly set.  Even for percentage sizing the min size of the parent depends on the children's size
---
 .../royale/spark/layouts/supportClasses/SparkLayoutBead.as    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/SparkLayoutBead.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/SparkLayoutBead.as
index 96a59ab..34b57d0 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/SparkLayoutBead.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/supportClasses/SparkLayoutBead.as
@@ -183,7 +183,16 @@ public class SparkLayoutBead extends org.apache.royale.core.LayoutBase
 	
 	override protected function childResizeHandler(event:Event):void
 	{
-		if (inUpdateDisplayList) return;
+		if (inUpdateDisplayList) 
+		{
+			// children are resizing during layout.
+			if (isNaN(target.explicitWidth) || isNaN(target.explicitHeight))
+			{
+				// that means our we need to be re-measured
+				target.invalidateSize();
+			}
+			return;
+		}
 		ranLayout = false;
 		super.childResizeHandler(event); // will set ranLayout if it did
 		if (!ranLayout)