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 2018/08/10 17:45:18 UTC

[royale-asjs] 04/09: don't set dimensions if we don't need to

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

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

commit ff7c97def5b2deeac53010c1bd2ad6b87d77ac73
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Aug 10 00:05:18 2018 -0700

    don't set dimensions if we don't need to
---
 .../MXRoyale/src/main/royale/mx/containers/beads/BoxLayout.as       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 bce2787..0c2f6a9 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
@@ -198,10 +198,14 @@ package mx.containers.beads
 			updateDisplayList(target.width, target.height);
 			
 			// update the target's actual size if needed.
-			if (target.isWidthSizedToContent() || target.isHeightSizedToContent()) {
+			if (target.isWidthSizedToContent() && target.isHeightSizedToContent()) {
 				target.setActualSize(target.getExplicitOrMeasuredWidth(), 
 					                 target.getExplicitOrMeasuredHeight());
 			}
+            else if (target.isWidthSizedToContent())
+                target.setWidth(target.getExplicitOrMeasuredWidth());
+            else if (target.isHeightSizedToContent())
+                target.setHeight(target.getExplicitOrMeasuredHeight());
 
 			return true;
 		}