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 2015/07/30 21:41:54 UTC

git commit: [flex-asjs] [refs/heads/develop] - adjust default TextInput width

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 364509efc -> c9519feec


adjust default TextInput width


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

Branch: refs/heads/develop
Commit: c9519feec79d53ad3f7cc903cf47bd214cc47b88
Parents: 364509e
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 30 12:41:49 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 30 12:41:49 2015 -0700

----------------------------------------------------------------------
 .../HTML/as/src/org/apache/flex/html/beads/TextInputView.as   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c9519fee/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
index fe530fd..ee6c1c1 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
@@ -70,20 +70,23 @@ package org.apache.flex.html.beads
 			
             var w:Number;
             var h:Number;
+            var uiMetrics:UIMetrics;
             var ilc:ILayoutChild = host as ILayoutChild;
             if (ilc.isWidthSizedToContent())
             {
+                uiMetrics = BeadMetrics.getMetrics(host);
                 // use default width of 20
                 var s:String = textField.text;
                 textField.text = "0";
                 w = textField.textWidth * 20;
                 h = textField.textHeight;
                 textField.text = s;
-                ilc.setWidth(w, true);
+                ilc.setWidth(w + uiMetrics.left + uiMetrics.right, true);
             }
             if (ilc.isHeightSizedToContent())
             {
-                var uiMetrics:UIMetrics = BeadMetrics.getMetrics(host);
+                if (!uiMetrics)
+                    uiMetrics = BeadMetrics.getMetrics(host);
                 if (isNaN(h))
                 {
                     s = textField.text;