From d996fd5c7688314525529ab75d45627f81584c60 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 29 May 2017 20:45:34 +0200 Subject: [PATCH] Code polish --- src/dorkbox/util/SwingUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dorkbox/util/SwingUtil.java b/src/dorkbox/util/SwingUtil.java index 4c75082..92cb49b 100644 --- a/src/dorkbox/util/SwingUtil.java +++ b/src/dorkbox/util/SwingUtil.java @@ -355,8 +355,9 @@ class SwingUtil { /** * 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 BufferedImage getFontAsImage(final Font font, String text, Color foregroundColor) { @@ -395,7 +396,7 @@ class SwingUtil { g2d.setColor(foregroundColor); // 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(); return img;