JAL-4260 right align the annotation labels regardless of width in wrapped mode.
[jalview.git] / src / jalview / gui / IdCanvas.java
index 2df84a9..4d10db0 100755 (executable)
@@ -307,7 +307,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
     if (alignViewport.getWrapAlignment())
     {
-      drawIdsWrapped(g, alignViewport, startSeq, getHeight());
+      drawIdsWrapped(g, alignViewport, startSeq, getHeight(), panelWidth,forGUI);
       return;
     }
 
@@ -401,7 +401,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     drawIdsWrapped(g, av2, totalHeight, totalHeight, i,false);
   }
 
-  void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
+  public void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
           int startSeq, int pageHeight, int idWidth, boolean forGUI)
   {
     int alignmentWidth = alignViewport.getAlignment().getWidth();
@@ -418,6 +418,8 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     AnnotationLabels labels = null;
     if (alignViewport.isShowAnnotation())
     {
+      // in wrapped mode, no alignPanel reference is available
+      // FIXME: make the renderer not create a new object in wrapped mode everytime!
       labels = new AnnotationLabels(alignViewport);
     }