Some fiddling to support a potential wacky project.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@104 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -254,7 +254,12 @@ public class ButtonSprite extends Sprite
|
||||
|
||||
// lay out the label if not already
|
||||
if (!_label.isLaidOut()) {
|
||||
_label.layout(_mgr.getMediaPanel());
|
||||
Graphics2D gfx = _mgr.createGraphics();
|
||||
try {
|
||||
_label.layout(gfx);
|
||||
} finally {
|
||||
gfx.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
updateBounds();
|
||||
|
||||
@@ -96,13 +96,17 @@ public class LabelSprite extends Sprite
|
||||
*/
|
||||
protected void layoutLabel ()
|
||||
{
|
||||
Graphics2D gfx = (Graphics2D)_mgr.getMediaPanel().getGraphics();
|
||||
if (gfx != null) {
|
||||
Graphics2D gfx = _mgr.createGraphics();
|
||||
if (gfx == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
(_antiAliased) ?
|
||||
RenderingHints.VALUE_ANTIALIAS_ON :
|
||||
RenderingHints.VALUE_ANTIALIAS_OFF);
|
||||
_label.layout(gfx);
|
||||
} finally {
|
||||
gfx.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user