From: amwaterhouse Date: Mon, 15 May 2006 13:28:35 +0000 (+0000) Subject: EPS font width is a double, check this for monospacedFont X-Git-Tag: Release_2_1~414 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=06adc6aa9e801677bd4ddb926ff9cf0b588f6f23;p=jalview.git EPS font width is a double, check this for monospacedFont --- 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; }