JAL-244 Fix buglet with automatic change in id column width not being recorded. More...
[jalview.git] / src / jalview / gui / IdCanvas.java
index ab21714..eb0715a 100755 (executable)
@@ -435,18 +435,20 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
       if (labels != null && alignViewport.isShowAnnotation())
       {
-        int thisIdWidth = getWidth();
+        int getWidth = getWidth();
+        int thisIdWidth = getWidth;
         g.translate(0, ypos + (alheight * charHeight));
         if (!manuallyAdjusted())
         {
           int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,
                   null);
           thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth;
-          if (thisIdWidth > getWidth())
+          if (thisIdWidth > getWidth)
           {
             this.setPreferredSize(
-                    new Dimension(this.getHeight(), thisIdWidth));
+                    new Dimension(thisIdWidth, this.getHeight()));
             this.repaint();
+            alignViewport.setIdWidth(thisIdWidth);
           }
         }
         labels.drawComponent(g, false, thisIdWidth);