JAL-244 More control of automatic idWidth adjustments. Added tests.
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index c4a40d8..255e1ff 100755 (executable)
@@ -1218,7 +1218,13 @@ public class AnnotationLabels extends JPanel
         {
           // If no manual adjustment to ID column with has been made then adjust
           // width match widest of alignment or annotation id widths
+          boolean allowShrink = Cache.getDefault("ALLOW_SHRINK_ID_WIDTH",
+                  false);
           width = Math.max(alignmentIdWidth, newAnnotationIdWidth);
+          if (clip && width < givenWidth && !allowShrink)
+          {
+            width = givenWidth;
+          }
         }
         else if (newAnnotationIdWidth != annotationIdWidth
                 && newAnnotationIdWidth > givenWidth
@@ -1268,6 +1274,11 @@ public class AnnotationLabels extends JPanel
   public int drawLabels(Graphics g, boolean clip, int width,
           boolean actuallyDraw, FontMetrics fmetrics)
   {
+    if (clip)
+    {
+      clip = Cache.getDefault("MOVE_SEQUENCE_ID_WITH_VISIBLE_ANNOTATIONS",
+              true);
+    }
     int actualWidth = 0;
     if (g != null)
     {