From f07bd6beab15adeb8c314adaf4ae9ef63dafd5d4 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 11 Sep 2006 15:42:43 +0000 Subject: [PATCH] get idWidth should use italic font when getting size --- src/jalview/gui/AlignmentPanel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); } -- 1.7.10.2