flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [1/2] git commit: [flex-asjs] [refs/heads/develop] - Better handling of padding values for buttons.
Date Tue, 03 Jun 2014 21:08:51 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 90d6f595c -> 103ecbbd5


Better handling of padding values for buttons.


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

Branch: refs/heads/develop
Commit: 5cf4dd9aee643a2b0d8570ca663c94ac602c4cf3
Parents: 90d6f59
Author: Peter Ent <pent@apache.org>
Authored: Tue Jun 3 17:07:41 2014 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Tue Jun 3 17:07:41 2014 -0400

----------------------------------------------------------------------
 .../src/org/apache/flex/html/beads/CSSButtonView.as | 12 +++++++++++-
 .../org/apache/flex/html/beads/CSSTextButtonView.as | 16 ++++++++++++----
 2 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5cf4dd9a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSButtonView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSButtonView.as
index d91f8c9..52775c8 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSButtonView.as
@@ -114,11 +114,21 @@ package org.apache.flex.html.beads
 			if (value != null)
 				borderThickness = value as uint;
 			var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+			var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+			var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right",
state);
+			var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+			var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom",
state);
+			if (paddingLeft == null) paddingLeft = padding;
+			if (paddingRight == null) paddingRight = padding;
+			if (paddingTop == null) paddingTop = padding;
+			if (paddingBottom == null) paddingBottom = padding;
+			
 			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color",
state);
 			if (borderStyle == "solid")
 			{
 				SolidBorderUtil.drawBorder(sprite.graphics, 
-					0, 0, sprite.width + Number(padding) * 2, sprite.height + Number(padding) * 2,
+					0, 0, sprite.width + Number(paddingLeft) + Number(paddingRight), 
+					sprite.height + Number(paddingTop) + Number(paddingBottom),
 					borderColor, backgroundColor, borderThickness);
 			}			
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5cf4dd9a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSTextButtonView.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSTextButtonView.as
index b8e0d33..2d6bd10 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -149,16 +149,24 @@ package org.apache.flex.html.beads
 			if (value != null)
 				borderThickness = value as uint;
 			var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+			var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+			var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right",
state);
+			var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+			var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom",
state);
+			if (paddingLeft == null) paddingLeft = padding;
+			if (paddingRight == null) paddingRight = padding;
+			if (paddingTop == null) paddingTop = padding;
+			if (paddingBottom == null) paddingBottom = padding;
 			var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color",
state);
 			if (borderStyle == "solid")
 			{
 				var useWidth:Number = Math.max(sw,textField.textWidth);
 				var useHeight:Number = Math.max(sh,textField.textHeight);
 				
-				if ((useWidth-2*Number(padding)-2*borderThickness) < textField.textWidth) 
-					useWidth = textField.textWidth+2*Number(padding)+2*borderThickness;
-				if ((useHeight-2*Number(padding)-2*borderThickness) < textField.textHeight) 
-					useHeight = textField.textHeight+2*Number(padding)+2*borderThickness;
+				if ((useWidth-Number(paddingLeft)-Number(paddingRight)-2*borderThickness) < textField.textWidth)

+					useWidth = textField.textWidth+Number(paddingLeft)+Number(paddingRight)+2*borderThickness;
+				if ((useHeight-Number(paddingTop)-Number(paddingBottom)-2*borderThickness) < textField.textHeight)

+					useHeight = textField.textHeight+Number(paddingTop)+Number(paddingBottom)+2*borderThickness;
 				
 				SolidBorderUtil.drawBorder(sprite.graphics, 
 					0, 0, useWidth, useHeight,


Mime
View raw message