From 300d14c438f7518a705ffa6e00e65bc25c63906a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 14 Jun 2007 21:45:42 +0000 Subject: [PATCH] Some layout fixes. These buttons are still really ugly, alas. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@264 ed5b42cb-e716-0410-a449-f6a68f950b19 --- .../com/threerings/flash/SimpleTextButton.as | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/as/com/threerings/flash/SimpleTextButton.as b/src/as/com/threerings/flash/SimpleTextButton.as index 2f5a2e51..bc065856 100644 --- a/src/as/com/threerings/flash/SimpleTextButton.as +++ b/src/as/com/threerings/flash/SimpleTextButton.as @@ -53,31 +53,23 @@ public class SimpleTextButton extends SimpleButton label.text = text; label.textColor = foreground; label.autoSize = TextFieldAutoSize.LEFT; + face.addChild(label); - var w :Number = label.textWidth + 2 * padding; - var h :Number = label.textHeight + 2 * padding; + var w :Number = label.width + 2 * padding; + var h :Number = label.height + 2 * padding; - // create our button background (and outline) - var button :Shape = new Shape(); - button.graphics.beginFill(background); + // draw our button background (and outline) + face.graphics.beginFill(background); + face.graphics.lineStyle(1, foreground); if (rounded) { - button.graphics.drawRoundRect(0, 0, w, h, padding, padding); + face.graphics.drawRoundRect(0, 0, w, h, padding, padding); } else { - button.graphics.drawRect(0, 0, w, h); + face.graphics.drawRect(0, 0, w, h); } - button.graphics.endFill(); - button.graphics.lineStyle(1, foreground); - if (rounded) { - button.graphics.drawRoundRect(0, 0, w, h, padding, padding); - } else { - button.graphics.drawRect(0, 0, w, h); - } - - face.addChild(button); + face.graphics.endFill(); label.x = padding; label.y = padding; - face.addChild(label); return face; }