- // draw main sequence panel
- pg.translate(idWidth, 0);
- getSeqPanel().seqCanvas.drawPanel(pg, startRes, endRes, startSeq,
- endSeq, 0);
-
- if (av.isShowAnnotation() && (endSeq == av.getAlignment().getHeight()))
- {
- // draw annotation - need to offset for current scroll position
- int offset = -getAlabels().getScrollOffset();
- pg.translate(0, offset);
- pg.translate(-idWidth - 3, (endSeq - startSeq) * av.getCharHeight()
- + 3);
- getAlabels().drawComponent(pg, idWidth);
- pg.translate(idWidth + 3, 0);
+ if (av.isShowAnnotation() && (endSeq == alignmentHeight))
+ {
+ /*
+ * draw annotation labels; drawComponent() translates by
+ * getScrollOffset(), so compensate for that first;
+ * then reset to (0, scale height)
+ */
+ int offset = getAlabels().getScrollOffset();
+ idGraphics.translate(0, -offset);
+ idGraphics.translate(0, alignmentDrawnHeight);
+ getAlabels().drawComponent(idGraphics, idWidth);
+ idGraphics.translate(0, -alignmentDrawnHeight);
+
+ /*
+ * draw the annotations starting at
+ * (idOffset, alignmentHeight) from (0, scaleHeight)
+ */
+ alignmentGraphics.translate(alignmentGraphicsOffset, alignmentDrawnHeight);