get idWidth should use italic font when getting size
authoramwaterhouse <Andrew Waterhouse>
Mon, 11 Sep 2006 15:42:43 +0000 (15:42 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 11 Sep 2006 15:42:43 +0000 (15:42 +0000)
src/jalview/gui/AlignmentPanel.java

index cc6ef51..4d79b65 100755 (executable)
@@ -324,7 +324,9 @@ public class AlignmentPanel extends GAlignmentPanel
   {\r
     Container c = new Container();\r
 \r
-    FontMetrics fm = c.getFontMetrics(av.font);\r
+    FontMetrics fm = c.getFontMetrics(\r
+      new Font(av.font.getName(), Font.ITALIC, av.font.getSize()));\r
+\r
     AlignmentI al = av.getAlignment();\r
 \r
     int i = 0;\r
@@ -339,7 +341,9 @@ public class AlignmentPanel extends GAlignmentPanel
 \r
       if (fm.stringWidth(id) > idWidth)\r
       {\r
+\r
         idWidth = fm.stringWidth(id);\r
+        System.out.println(id+" "+idWidth);\r
       }\r
 \r
       i++;\r
@@ -364,7 +368,7 @@ public class AlignmentPanel extends GAlignmentPanel
         i++;\r
       }\r
     }\r
-\r
+    System.out.println(idWidth);\r
     return new Dimension(idWidth, 12);\r
   }\r
 \r