// 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));