Merge branch 'develop' into bug/JAL-4059_update_swingJS_for_JalviewJS_2_11_2_and_2_11_3
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index ce87c01..e2c91ba 100644 (file)
@@ -341,7 +341,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
       if (Jalview.isHeadlessMode())
       {
         AnnotationLabels aal = getAlabels();
-        int stringWidth = aal.drawLabels(null, false, idWidth, false, false, fm);
+        int stringWidth = aal.drawLabels(null, false, idWidth, false, false,
+                fm);
         idWidth = Math.max(idWidth, stringWidth);
       }
       else
@@ -997,7 +998,15 @@ public class AlignmentPanel extends GAlignmentPanel implements
           Graphics idGraphics, Graphics alignmentGraphics)
           throws PrinterException
   {
-    final int idWidth = getVisibleIdWidth(false);
+    final int idWidth;
+    if (getIdPanel()!=null && getIdPanel().getWidth()>0)
+    {
+      // use the current IdPanel's width, if its set and non-zero
+      idWidth = getIdPanel().getWidth();
+    } else { 
+      // otherwise calculate it
+      idWidth = getVisibleIdWidth(false);
+    }
 
     /*
      * Get the horizontal offset to where we draw the sequences.
@@ -1229,7 +1238,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
           throws ImageOutputException
   {
     makeAlignmentImage(type, file, renderer,
-            BitmapImageSizing.nullBitmapImageSizing());
+            BitmapImageSizing.defaultBitmapImageSizing());
   }
 
   /**