X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationLabels.java;h=241e0a3776c94e9d497663f8512bb32f5856ec50;hb=15c3c0e89d9157187e1ccc6962b115cb255dd04a;hp=afee3d026d294fa9263898257c76909aa9849519;hpb=24eb9d2701c4f51c1a3a8ce9536ed579988f0179;p=jalview.git diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index afee3d0..241e0a3 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -1206,6 +1206,7 @@ public class AnnotationLabels extends JPanel Graphics dummy = g2d.create(); int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, null); + dummy.dispose(); Dimension d = ap.calculateDefaultAlignmentIdWidth(); int alignmentIdWidth = d.width; if (iwa != null && !iwa.manuallyAdjusted()) @@ -1230,6 +1231,14 @@ public class AnnotationLabels extends JPanel } } } + else + { + Graphics2D g2d = (Graphics2D) g; + Graphics dummy = g2d.create(); + int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, + null); + width = Math.max(newAnnotationIdWidth, givenWidth); + } drawLabels(g, clip, width, true, null); } @@ -1255,7 +1264,7 @@ public class AnnotationLabels extends JPanel boolean actuallyDraw, FontMetrics fmetrics) { int actualWidth = 0; - if (actuallyDraw && g != null) + if (g != null) { if (av.getFont().getSize() < 10) {