flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [5/5] git commit: [flex-asjs] [refs/heads/develop] - more fixes to width/height handling
Date Thu, 30 Jul 2015 18:23:51 GMT
more fixes to width/height handling


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

Branch: refs/heads/develop
Commit: 9c5d176a338d7b3e2c6538a28ac8b38289e63718
Parents: 16cbd77
Author: Alex Harui <aharui@apache.org>
Authored: Thu Jul 30 11:23:41 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Jul 30 11:23:41 2015 -0700

----------------------------------------------------------------------
 .../Core/as/src/org/apache/flex/core/UIBase.as  | 63 +++++++-------------
 1 file changed, 22 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9c5d176a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
index 4a2916f..0fde64e 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIBase.as
@@ -165,14 +165,6 @@ package org.apache.flex.core
          */
 		public function get explicitWidth():Number
 		{
-			if (isNaN(_explicitWidth))
-			{
-				var value:* = ValuesManager.valuesImpl.getValue(this, "width");
-				if (value !== undefined) {
-					_explicitWidth = Number(value);
-				}
-			}
-			
 			return _explicitWidth;
 		}
 
@@ -206,14 +198,6 @@ package org.apache.flex.core
          */
         public function get explicitHeight():Number
 		{
-			if (isNaN(_explicitHeight))
-			{
-				var value:* = ValuesManager.valuesImpl.getValue(this, "height");
-				if (value !== undefined) {
-					_explicitHeight = Number(value);
-				}
-			}
-			
 			return _explicitHeight;
 		}
         
@@ -482,9 +466,6 @@ package org.apache.flex.core
                 return false;
             if (!isNaN(_percentWidth))
                 return false;
-            var value:* = ValuesManager.valuesImpl.getValue(this, "width");
-            if (value !== undefined)
-                return false;
             var left:* = ValuesManager.valuesImpl.getValue(this, "left");
             var right:* = ValuesManager.valuesImpl.getValue(this, "right");
             return (left === undefined || right === undefined);
@@ -505,9 +486,6 @@ package org.apache.flex.core
                 return false;
             if (!isNaN(_percentHeight))
                 return false;
-            var value:* = ValuesManager.valuesImpl.getValue(this, "height");
-            if (value !== undefined)
-                return false;
             var top:* = ValuesManager.valuesImpl.getValue(this, "top");
             var bottom:* = ValuesManager.valuesImpl.getValue(this, "bottom");
             return (top === undefined || bottom === undefined);          
@@ -895,30 +873,33 @@ package org.apache.flex.core
         {
             var c:Class;
 			
-			if (isNaN(_width)) {
+			if (isNaN(_width) && isNaN(_percentWidth)) 
+            {
 				var value:* = ValuesManager.valuesImpl.getValue(this,"width");
-				if (value !== undefined) {
-					var s:String = String(value);
-					var lastChar:String = s.substr(s.length-1,s.length);
-					if (lastChar == "%") {
-						_percentWidth = Number(s);
-					}
-					else {
-						_width = Number(s);
-					}
+				if (value !== undefined) 
+                {
+					if (value is String)
+                    {
+                        var s:String = String(value);
+    					_percentWidth = Number(s.substring(0, s.length - 1));
+                    }
+					else 
+						_width = value as Number;
 				}
 			}
 			
-			if (isNaN(_height)) {
+			if (isNaN(_height) && isNaN(_percentHeight)) 
+            {
 				value = ValuesManager.valuesImpl.getValue(this,"height");
-				if (value !== undefined) {
-					s = String(value);
-					lastChar = s.substr(s.length-1,s.length);
-					if (lastChar == "%") {
-						_percentHeight = Number(s);
-					} else {
-						_height = Number(s);
-					}
+				if (value !== undefined) 
+                {
+                    if (value is String)
+                    {
+    					s = String(value);
+						_percentHeight = Number(s.substring(0, s.length - 1));
+					} 
+                    else
+						_height = value as Number;
 				}
 			}
             


Mime
View raw message