From: amwaterhouse Date: Mon, 11 Sep 2006 15:42:43 +0000 (+0000) Subject: get idWidth should use italic font when getting size X-Git-Tag: Release_2_1_1~10 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f07bd6beab15adeb8c314adaf4ae9ef63dafd5d4;p=jalview.git get idWidth should use italic font when getting size --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index cc6ef51..4d79b65 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -324,7 +324,9 @@ public class AlignmentPanel extends GAlignmentPanel { Container c = new Container(); - FontMetrics fm = c.getFontMetrics(av.font); + FontMetrics fm = c.getFontMetrics( + new Font(av.font.getName(), Font.ITALIC, av.font.getSize())); + AlignmentI al = av.getAlignment(); int i = 0; @@ -339,7 +341,9 @@ public class AlignmentPanel extends GAlignmentPanel if (fm.stringWidth(id) > idWidth) { + idWidth = fm.stringWidth(id); + System.out.println(id+" "+idWidth); } i++; @@ -364,7 +368,7 @@ public class AlignmentPanel extends GAlignmentPanel i++; } } - + System.out.println(idWidth); return new Dimension(idWidth, 12); }