if (sx < 0)
{
- // ex += sx;
- // sx = 0;
+ ex += sx;
+ sx = 0;
}
if (sx + ex > visWidth)
*/
private BufferedImage drawSelectionGroup()
{
+ int verticalOffset = 0;
+ if (av.getWrapAlignment())
+ {
+ verticalOffset = charHeight;
+ if (av.getScaleAboveWrapped())
+ {
+ verticalOffset += charHeight;
+ }
+ }
+
// get a new image of the correct size
BufferedImage selectionImage = setupImage();
// set up drawing colour
Graphics2D g = (Graphics2D) selectionImage.getGraphics();
+ g.translate(LABEL_WEST, 0);
// set background to transparent
g.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
g.fillRect(0, 0, selectionImage.getWidth(), selectionImage.getHeight());
int startSeq = av.getRanges().getStartSeq();
for (i = startSeq; i <= av.getRanges().getEndSeq(); ++i)
{
- int sy = (i - startSeq) * charHeight;
+ int sy = verticalOffset + (i - startSeq) * charHeight;
if (group.getSequences(null)
.contains(av.getAlignment().getSequenceAt(i)))
}
if (inGroup)
{
- int sy = (i - startSeq) * charHeight;
+ int sy = verticalOffset + (i - startSeq) * charHeight;
if (startx >= 0 && startx < visWidth)
{
g.drawLine(startx, oldY, startx, sy);
inGroup = false;
}
-
+ g.translate(-LABEL_WEST, 0);
return selectionImage;
}