Code polish

This commit is contained in:
nathan 2017-05-29 20:45:34 +02:00
parent b8e4f2353e
commit d996fd5c76
1 changed files with 4 additions and 3 deletions

View File

@ -355,8 +355,9 @@ class SwingUtil {
/** /**
* Gets the specified text (with a font) and as an image * Gets the specified text (with a font) and as an image
* @param font *
* @return * @param font the specified font to render the image
* @return a BufferedImage of the specified text, font, and color
*/ */
public static public static
BufferedImage getFontAsImage(final Font font, String text, Color foregroundColor) { BufferedImage getFontAsImage(final Font font, String text, Color foregroundColor) {
@ -395,7 +396,7 @@ class SwingUtil {
g2d.setColor(foregroundColor); g2d.setColor(foregroundColor);
// width/4 centers the text in the image // width/4 centers the text in the image
g2d.drawString(text, width/4, fm.getAscent()); g2d.drawString(text, width/4.0f, fm.getAscent());
g2d.dispose(); g2d.dispose();
return img; return img;