Merge branch 'features/JAL-2349_matrixvis' into features/JAL-2349_matrixvis_2112
[jalview.git] / src / jalview / renderer / ContactMapRenderer.java
index dac8882..7413e65 100644 (file)
@@ -48,7 +48,7 @@ public class ContactMapRenderer implements AnnotationRowRendererI
       column = sRes + x;
       if (hasHiddenColumns)
       {
-        column = hiddenColumns.adjustForHiddenColumns(column);
+        column = hiddenColumns.visibleToAbsoluteColumn(column);
       }
 
       if (column > aaMax)
@@ -72,14 +72,14 @@ public class ContactMapRenderer implements AnnotationRowRendererI
 
       // cell height to render
       double scale = (_aa.graphHeight < contacts.getContactHeight()) ? 1
-              : (((double) _aa.graphHeight) / (double) contacts
-                      .getContactHeight());
+              : ((double) _aa.graphHeight)
+                      / (double) contacts.getContactHeight();
       int cstart, cend = -1;
       for (int ht = y2, eht = y2 - _aa.graphHeight; ht >= eht; ht -= scale)
       {
         cstart = cend + 1;
-        cend = -1
-                + (contacts.getContactHeight() * (ht - eht) / _aa.graphHeight);
+        cend = Math.max(cstart + 1, contacts.getContactHeight()
+                * ((ht - y2) / _aa.graphHeight));
         // TODO show maximum colour for range - sort of done
         // also need a 'getMaxPosForRange(start,end)'
         g.setColor(getColorForRange(min, max, contacts, cstart, cend));