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/06/08 07:05:17 UTC

[5/6] git commit: [flex-asjs] [refs/heads/release0.8.0] - handle sizedToContent by growing to content instead of shrinking things

handle sizedToContent by growing to content instead of shrinking things


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

Branch: refs/heads/release0.8.0
Commit: 5ebb2aebcfd09d5b91cccc6c088dc4b79b9fb2c1
Parents: 93e2665
Author: Alex Harui <ah...@apache.org>
Authored: Wed Jun 7 22:47:27 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Jun 7 23:23:05 2017 -0700

----------------------------------------------------------------------
 .../flex/html/beads/layouts/VerticalFlexLayout.as     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ebb2aeb/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
index 0b845b5..4d86f14 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/VerticalFlexLayout.as
@@ -128,8 +128,16 @@ package org.apache.flex.html.beads.layouts
 				
 				// adjust the host's usable size by the metrics. If hostSizedToContent, then the
 				// resulting adjusted value may be less than zero.
-				hostWidth -= paddingMetrics.left + paddingMetrics.right + borderMetrics.left + borderMetrics.right;
-				hostHeight -= paddingMetrics.top + paddingMetrics.bottom + borderMetrics.top + borderMetrics.bottom;
+				var extra:Number = paddingMetrics.left + paddingMetrics.right + borderMetrics.left + borderMetrics.right;
+				if (hostWidthSizedToContent)
+					hostWidth += extra;
+				else
+					hostWidth -= extra;
+				extra = paddingMetrics.top + paddingMetrics.bottom + borderMetrics.top + borderMetrics.bottom;
+				if (hostHeightSizedToContent)
+					hostHeight += extra;
+				else
+					hostHeight -= extra;
 				
 				var remainingHeight:Number = hostHeight;
 
@@ -194,7 +202,7 @@ package org.apache.flex.html.beads.layouts
 					useWidth = (data.width < 0 ? hostWidth : data.width);
 
 					var setHeight:Boolean = true;
-					if (data.height != 0) {
+					if (data.height != 0 && !hostHeightSizedToContent) {
 						if (data.grow > 0 && growCount > 0) {
 							useHeight = remainingHeight / growCount;
 							setHeight = false;