Merge branch 'bug/JAL-4290_headless_alignment_export_with_structure_annotations_doesn...
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index 8e7c745..0f5a9e8 100644 (file)
@@ -388,7 +388,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
     // Also check annotation label widths
     if (includeAnnotations && al.getAlignmentAnnotation() != null)
     {
-      fm = c.getFontMetrics(getAlabels().getFont());
+      if (legacy)
+      {
+        fm = c.getFontMetrics(getAlabels().getFont());
+      }
 
       if (!legacy || Jalview.isHeadlessMode())
       {
@@ -1300,8 +1303,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
       return idwidth.intValue() + ID_WIDTH_PADDING;
     }
 
-    int w = getIdPanel().getWidth();
-    w = calculateIdWidth(-1, true, true).width;
+    // int w = getIdPanel().getWidth();
+    // w = calculateIdWidth(-1, true, true).width;
+    int w = calculateIdWidth(-1, true, true).width;
     return (w > 0 ? w : calculateIdWidth().width);
   }
 
@@ -1379,7 +1383,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
         // need to obtain default alignment width and then add in any
         // additional allowance for id margin
         // this duplicates the calculation in getWrappedHeight but adjusts for
-        // offscreen idWith
+        // offscreen idWidth
         width = alignFrame.getWidth() - vscroll.getPreferredSize().width
                 - alignFrame.getInsets().left - alignFrame.getInsets().right
                 - getVisibleIdWidth() + getVisibleIdWidth(false);