From 06adc6aa9e801677bd4ddb926ff9cf0b588f6f23 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 15 May 2006 13:28:35 +0000 Subject: [PATCH] EPS font width is a double, check this for monospacedFont --- src/jalview/gui/SequenceRenderer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 02ea4b5..f41a0b9 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -61,7 +61,14 @@ public class SequenceRenderer { graphics = g; fm = g.getFontMetrics(); - monospacedFont = fm.getStringBounds("M",g).getWidth()==fm.getStringBounds("|",g).getWidth(); + + // If EPS graphics, stringWidth will be a double, not an int + double dwidth = fm.getStringBounds("M", g).getWidth(); + + monospacedFont = + dwidth == fm.getStringBounds("|",g).getWidth() + && dwidth == (int)dwidth; + this.renderGaps = renderGaps; } -- 1.7.10.2