JAL-2759 First pass instantiate hiddenColumns collection in constructor
[jalview.git] / src / jalview / renderer / ScaleRenderer.java
index 63e5fa4..c7406a5 100644 (file)
@@ -34,12 +34,24 @@ import java.util.List;
  */
 public class ScaleRenderer
 {
+  /**
+   * Represents one major or minor scale mark
+   */
   public final class ScaleMark
   {
+    /**
+     * true for a major scale mark, false for minor
+     */
     public final boolean major;
 
+    /**
+     * visible column position (0..) e.g. 19
+     */
     public final int column;
 
+    /**
+     * text (if any) to show e.g. "20"
+     */
     public final String text;
 
     ScaleMark(boolean isMajor, int col, String txt)
@@ -96,20 +108,20 @@ public class ScaleRenderer
     String string;
     int refN, iadj;
     // todo: add a 'reference origin column' to set column number relative to
-    for (int i = scalestartx; i < endx; i += 5)
+    for (int i = scalestartx; i <= endx; i += 5)
     {
       if (((i - refSp) % 10) == 0)
       {
         if (refSeq == null)
         {
           iadj = av.getAlignment().getHiddenColumns()
-                  .adjustForHiddenColumns(i - 1) + 1;
+                  .visibleToAbsoluteColumn(i - 1) + 1;
           string = String.valueOf(iadj);
         }
         else
         {
           iadj = av.getAlignment().getHiddenColumns()
-                  .adjustForHiddenColumns(i - 1);
+                  .visibleToAbsoluteColumn(i - 1);
           refN = refSeq.findPosition(iadj);
           // TODO show bounds if position is a gap
           // - ie L--R -> "1L|2R" for