JAL-3364 tweaks to override of FIGURE_FIXEDIDWIDTH for split frame image
[jalview.git] / src / jalview / renderer / AnnotationRenderer.java
index 41772d4..dcf2f20 100644 (file)
@@ -162,7 +162,8 @@ public class AnnotationRenderer
           boolean validRes, boolean validEnd)
   {
     g.setColor(STEM_COLOUR);
-    int sCol = (lastSSX / charWidth) + startRes;
+    int sCol = (lastSSX / charWidth)
+            + hiddenColumns.visibleToAbsoluteColumn(startRes);
     int x1 = lastSSX;
     int x2 = (x * charWidth);
 
@@ -228,7 +229,8 @@ public class AnnotationRenderer
     // System.out.println(nonCanColor);
 
     g.setColor(nonCanColor);
-    int sCol = (lastSSX / charWidth) + startRes;
+    int sCol = (lastSSX / charWidth)
+            + hiddenColumns.visibleToAbsoluteColumn(startRes);
     int x1 = lastSSX;
     int x2 = (x * charWidth);
 
@@ -417,6 +419,8 @@ public class AnnotationRenderer
 
   boolean rna = false;
 
+  private int lastDrawnHeight;
+
   /**
    * Render the annotation rows associated with an alignment.
    * 
@@ -600,7 +604,7 @@ public class AnnotationRenderer
         {
           if (hasHiddenColumns)
           {
-            column = hiddenColumns.adjustForHiddenColumns(startRes + x);
+            column = hiddenColumns.visibleToAbsoluteColumn(startRes + x);
             if (column > row_annotations.length - 1)
             {
               break;
@@ -1091,11 +1095,22 @@ public class AnnotationRenderer
       System.err.println("Annotation Rendering time:"
               + (System.currentTimeMillis() - stime));
     }
-    ;
+    lastDrawnHeight = y;
 
     return !usedFaded;
   }
 
+  /**
+   * Answers the height in pixels of what was drawn on the graphics in the last
+   * call to {@code drawComponent}
+   * 
+   * @return
+   */
+  public int getLastDrawnHeight()
+  {
+    return lastDrawnHeight;
+  }
+
   public static final Color GLYPHLINE_COLOR = Color.gray;
 
   public static final Color SHEET_COLOUR = Color.green;
@@ -1147,7 +1162,8 @@ public class AnnotationRenderer
   {
     g.setColor(HELIX_COLOUR);
 
-    int sCol = (lastSSX / charWidth) + startRes;
+    int sCol = (lastSSX / charWidth)
+            + hiddenColumns.visibleToAbsoluteColumn(startRes);
     int x1 = lastSSX;
     int x2 = (x * charWidth);
 
@@ -1247,7 +1263,7 @@ public class AnnotationRenderer
       column = sRes + x;
       if (hasHiddenColumns)
       {
-        column = hiddenColumns.adjustForHiddenColumns(column);
+        column = hiddenColumns.visibleToAbsoluteColumn(column);
       }
 
       if (column > aaMax)
@@ -1327,7 +1343,7 @@ public class AnnotationRenderer
       column = sRes + x;
       if (hasHiddenColumns)
       {
-        column = hiddenColumns.adjustForHiddenColumns(column);
+        column = hiddenColumns.visibleToAbsoluteColumn(column);
       }
 
       if (column > aaMax)