diff --git a/src/java/com/threerings/media/sprite/LabelSprite.java b/src/java/com/threerings/media/sprite/LabelSprite.java index e27ad7fdc..905927e9c 100644 --- a/src/java/com/threerings/media/sprite/LabelSprite.java +++ b/src/java/com/threerings/media/sprite/LabelSprite.java @@ -77,15 +77,7 @@ public class LabelSprite extends Sprite // if our label is not yet laid out, do the deed if (!_label.isLaidOut()) { - Graphics2D gfx = (Graphics2D)_mgr.getMediaPanel().getGraphics(); - if (gfx != null) { - gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - (_antiAliased) ? - RenderingHints.VALUE_ANTIALIAS_ON : - RenderingHints.VALUE_ANTIALIAS_OFF); - _label.layout(gfx); - gfx.dispose(); - } + layoutLabel(); } // size the bounds to fit our label @@ -98,6 +90,23 @@ public class LabelSprite extends Sprite _label.render(gfx, _bounds.x, _bounds.y); } + /** + * Lays out our underlying label which must be done if the text is + * changed. + */ + protected void layoutLabel () + { + Graphics2D gfx = (Graphics2D)_mgr.getMediaPanel().getGraphics(); + if (gfx != null) { + gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + (_antiAliased) ? + RenderingHints.VALUE_ANTIALIAS_ON : + RenderingHints.VALUE_ANTIALIAS_OFF); + _label.layout(gfx); + gfx.dispose(); + } + } + /** The label associated with this sprite. */ protected Label _label;