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 <[email protected]> Authored: Thu Jul 30 12:41:49 2015 -0700 Committer: Alex Harui <[email protected]> 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;
