X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FContactMapRenderer.java;h=809ced03651d78ce3a3b6113964a39d393f01bfd;hb=c2e0797f0a114da79ed00e67ec029a3e83496d8d;hp=1f235b31c0b44c2bc11cc093a5df42d60a3064c8;hpb=10c287e10560169a80c575b7d1f6fd7f4695cf49;p=jalview.git diff --git a/src/jalview/renderer/ContactMapRenderer.java b/src/jalview/renderer/ContactMapRenderer.java index 1f235b3..809ced0 100644 --- a/src/jalview/renderer/ContactMapRenderer.java +++ b/src/jalview/renderer/ContactMapRenderer.java @@ -73,17 +73,15 @@ public class ContactMapRenderer implements AnnotationRowRendererI double scale = (_aa.graphHeight < contacts.getContactHeight()) ? 1 : (((double) _aa.graphHeight) / (double) contacts .getContactHeight()); - // distance between contact map per cell - int step = (int) ((contacts.getContactHeight()) * scale / _aa.graphHeight); - - // profl[1] is the number of values in the profile - for (int stp = 0, ht = y2, eht = y2 - _aa.graphHeight; ht > eht; ht -= scale, stp++) + int cstart, cend = -1; + for (int ht = y2, eht = y2 - _aa.graphHeight; ht >= eht; ht -= scale) { - // TODO show maximum colour for range + cstart = cend + 1; + cend = -1 + + (contacts.getContactHeight() * (ht - eht) / _aa.graphHeight); + // TODO show maximum colour for range - sort of done // also need a 'getMaxPosForRange(start,end)' - g.setColor(contacts - .getColorForScore((int) (stp * step * ((double) _aa.graphHeight / (double) contacts - .getContactHeight())))); + g.setColor(contacts.getColorForRange(cstart, cend)); if (scale > 1) {