From: Jim Procter Date: Sun, 11 Jun 2017 01:03:49 +0000 (+1000) Subject: JAL-2349 scaling matrix column to annotation height X-Git-Tag: Release_2_11_3_0~23^2~60^2~9^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f0396bb4ab9e52c708accd64eb326b0f1262637e;p=jalview.git JAL-2349 scaling matrix column to annotation height --- diff --git a/src/jalview/renderer/ContactMapRenderer.java b/src/jalview/renderer/ContactMapRenderer.java index dac8882..bed54e8 100644 --- a/src/jalview/renderer/ContactMapRenderer.java +++ b/src/jalview/renderer/ContactMapRenderer.java @@ -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));