flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [03/50] git commit: [flex-asjs] [refs/heads/tlf] - if sizedToContent, don't show a scrollbar
Date Tue, 30 May 2017 19:47:38 GMT
if sizedToContent, don't show a scrollbar


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

Branch: refs/heads/tlf
Commit: 23c4c7a51640884ae5af64541ff6a4f5515af183
Parents: 43bbbdb
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 23 00:11:28 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 23 00:15:57 2017 -0700

----------------------------------------------------------------------
 .../flex/html/supportClasses/ScrollingViewport.as     | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/23c4c7a5/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
index 444606b..fb6d784 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
@@ -188,11 +188,13 @@ package org.apache.flex.html.supportClasses
          */
 		override public function layoutViewportAfterContentLayout(contentSize:Size):void
 		{
+			var host:UIBase = UIBase(_strand);
+			
 			var hadV:Boolean = _verticalScroller != null && _verticalScroller.visible;
 			var hadH:Boolean = _horizontalScroller != null && _horizontalScroller.visible;
 			
-			var hostWidth:Number = UIBase(_strand).width;
-			var hostHeight:Number = UIBase(_strand).height;
+			var hostWidth:Number = host.width;
+			var hostHeight:Number = host.height;
 			
 			var borderMetrics:org.apache.flex.geom.Rectangle = CSSContainerUtils.getBorderMetrics(_strand);
 			
@@ -202,6 +204,14 @@ package org.apache.flex.html.supportClasses
 			var needV:Boolean = contentSize.height > viewportHeight;
 			var needH:Boolean = contentSize.width > viewportWidth;
 			
+			// if sized to content, the container should stretch to fit, making the original
+			// viewport dimensions obsolete and scrollbars unnecessary.
+			// This might not work for the flexible child.
+			if (host.isWidthSizedToContent())
+				needH = false;
+			if (host.isHeightSizedToContent())
+				needV = false;
+
 			if (needV)
 			{
 				if (_verticalScroller == null) {


Mime
View raw message