diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/window/MessageWindow.java')
-rw-r--r-- | src/com/fourisland/fourpuzzle/window/MessageWindow.java | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/com/fourisland/fourpuzzle/window/MessageWindow.java b/src/com/fourisland/fourpuzzle/window/MessageWindow.java index 595fb55..fb90f04 100644 --- a/src/com/fourisland/fourpuzzle/window/MessageWindow.java +++ b/src/com/fourisland/fourpuzzle/window/MessageWindow.java | |||
@@ -28,15 +28,7 @@ import java.util.concurrent.CountDownLatch; | |||
28 | public class MessageWindow implements Renderable { | 28 | public class MessageWindow implements Renderable { |
29 | 29 | ||
30 | private static final int SPACER = 4; | 30 | private static final int SPACER = 4; |
31 | private static final int HEIGHT; | 31 | private static final int HEIGHT = (4*(Display.getFontMetrics().getHeight()+SPACER)); |
32 | |||
33 | static | ||
34 | { | ||
35 | BufferedImage d = Display.createCanvas(1, 1); | ||
36 | Display.setFont(d.createGraphics()); | ||
37 | |||
38 | HEIGHT = 3*(d.createGraphics().getFontMetrics().getHeight()+SPACER); | ||
39 | } | ||
40 | 32 | ||
41 | String message; | 33 | String message; |
42 | private volatile List<String> messages; | 34 | private volatile List<String> messages; |
@@ -191,7 +183,7 @@ public class MessageWindow implements Renderable { | |||
191 | g2.setPaint(new TexturePaint(SystemGraphic.getTextColor(), new Rectangle(tx, ty, fw, fh))); | 183 | g2.setPaint(new TexturePaint(SystemGraphic.getTextColor(), new Rectangle(tx, ty, fw, fh))); |
192 | g2.drawString(message.substring(0, Math.min(toPrint, message.length())), tx, ty); | 184 | g2.drawString(message.substring(0, Math.min(toPrint, message.length())), tx, ty); |
193 | 185 | ||
194 | ty+=(SPACER+g2.getFontMetrics().getHeight()); | 186 | ty+=(SPACER+fh); |
195 | 187 | ||
196 | toPrint -= Math.min(toPrint, message.length()); | 188 | toPrint -= Math.min(toPrint, message.length()); |
197 | } | 189 | } |