From bed54fafd288a7cf39f15262522b0f2503883479 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 7 Apr 2005 16:59:48 +0000 Subject: [PATCH] check annotation label widths as well as id widths --- src/jalview/gui/AlignmentPanel.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 75729c3..c38b7dc 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -156,6 +156,20 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene i++; } + // Also check annotation label widths + i=0; + if(al.getAlignmentAnnotation()!=null) + { + fm = g.getFontMetrics(alabels.getFont()); + while (i < al.getAlignmentAnnotation().length) + { + String label = al.getAlignmentAnnotation()[i].label; + if (fm.stringWidth(label) > idWidth) + idWidth = fm.stringWidth(label); + i++; + } + } + return new Dimension(idWidth, 12); } -- 1.7.10.2