for (i = startSeq; i <= endSeq; i++)
{
+ // position of start residue of group relative to startRes, in pixels
sx = (group.getStartRes() - startRes) * charWidth;
sy = offset + ((i - startSeq) * charHeight);
+ // width of group in pixels
ex = (((group.getEndRes() + 1) - group.getStartRes()) * charWidth) - 1;
if (sx + ex < 0 || sx > visWidth)
{
if (inGroup)
{
+ // if start position is visible, draw vertical line to left of
+ // group
if (sx >= 0 && sx < visWidth)
{
g.drawLine(sx, oldY, sx, sy);
}
+ // if end position is visible, draw vertical line to right of
+ // group
if (sx + ex < visWidth)
{
g.drawLine(sx + ex, oldY, sx + ex, sy);
if (sx < 0)
{
- ex += sx;
- sx = 0;
+ // ex += sx;
+ // sx = 0;
}
if (sx + ex > visWidth)
ex = (endRes - startRes + 1) * charWidth;
}
+ // draw horizontal line at top of group
if (top != -1)
{
g.drawLine(sx, top, sx + ex, top);
top = -1;
}
+ // draw horizontal line at bottom of group
if (bottom != -1)
{
g.drawLine(sx, bottom, sx + ex, bottom);