flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject [12/50] [abbrv] git commit: [flex-asjs] [refs/heads/tlf] - handle sizedToContent by growing to content instead of shrinking things
Date Sun, 18 Jun 2017 12:36:23 GMT
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/tlf
Commit: 5ebb2aebcfd09d5b91cccc6c088dc4b79b9fb2c1
Parents: 93e2665
Author: Alex Harui <aharui@apache.org>
Authored: Wed Jun 7 22:47:27 2017 -0700
Committer: Alex Harui <aharui@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;


Mime
View raw message