JAL-3858 fix off-by-one in matrix visualisation and interactive tooltip
[jalview.git] / src / jalview / datamodel / ContactListImpl.java
index 6a37864..bb31c5d 100644 (file)
@@ -1,5 +1,7 @@
 package jalview.datamodel;
 
+import java.awt.Color;
+
 import jalview.renderer.ContactGeometry.contactInterval;
 
 /**
@@ -53,9 +55,9 @@ public class ContactListImpl implements ContactListI
     {
       from_column = 0;
     }
-    if (to_column > getContactHeight())
+    if (to_column >= getContactHeight())
     {
-      to_column = getContactHeight();
+      to_column = getContactHeight()-1;
     }
     ContactRange cr = new ContactRange();
     cr.setFrom_column(from_column);
@@ -96,4 +98,16 @@ public class ContactListImpl implements ContactListI
     }
     return cr;
   }
+
+  @Override
+  public int[] getMappedPositionsFor(int cStart, int cEnd)
+  {
+    return clist.getMappedPositionsFor(cStart, cEnd);
+  }
+
+  @Override
+  public Color getColourForGroup()
+  {
+    return clist.getColourForGroup();
+  }
 }