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 2014/10/18 07:43:35 UTC

[18/30] git commit: [flex-asjs] [refs/heads/develop] - get this to size better

get this to size better


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

Branch: refs/heads/develop
Commit: 1219f6943d427d265171aa98b4548d8309e4a02b
Parents: df4ba1c
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 15 11:34:04 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Oct 17 22:38:46 2014 -0700

----------------------------------------------------------------------
 .../org/apache/flex/html/beads/ImageButtonView.as   | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1219f694/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
index 6eddb22..dcb3515 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/ImageButtonView.as
@@ -29,7 +29,8 @@ package org.apache.flex.html.beads
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IBeadView;
 	import org.apache.flex.core.IStrand;
-	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.core.UIButtonBase;
+    import org.apache.flex.core.ValuesManager;
 	
 	/**
 	 *  The ImageButtonView class provides an image-only view
@@ -103,7 +104,17 @@ package org.apache.flex.html.beads
 				var url:String = backgroundImage as String;
 				loader.load(new URLRequest(url));
 				loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void { 
-					updateHitArea();
+                    var host:UIButtonBase = UIButtonBase(_strand);
+                    if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
+                        host.setWidth(loader.content.width);
+                    else
+                        loader.content.width = host.width;
+                    
+                    if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
+                        host.setHeight(loader.content.height);
+                    else
+                        loader.content.height = host.height;
+                    updateHitArea();
 				});
 			}
 		}
@@ -117,7 +128,6 @@ package org.apache.flex.html.beads
 			shape.graphics.beginFill(0xCCCCCC);
 			shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
 			shape.graphics.endFill();
-			
 		}
 	}
 }
\ No newline at end of file