- // draw Scale
- if (isMultiGraphics)
- {
- pg[G1].translate(0, 0);
- getScalePanel().drawScale(pg[G1], startRes, endRes,
- pwidth - idWidth, scaleHeight);
- pg[G1].translate(-idWidth, scaleHeight);
- }
- else
- {
- pg[G0].translate(idWidth, 0);
- getScalePanel().drawScale(pg[G0], startRes, endRes, pwidth - idWidth,
- scaleHeight);
- pg[G0].translate(-idWidth, scaleHeight);
- }
-
- // //////////////
- // Draw the ids
- Color currentColor = null;
- Color currentTextColor = null;
-
- if (isMultiGraphics)
- {
- pg[G0].translate(0, scaleHeight);
- }
- pg[G0].setFont(getIdPanel().getIdCanvas().getIdfont());
-
- SequenceI seq;
- for (int i = startSeq; i < endSeq; i++)
- {
- seq = av.getAlignment().getSequenceAt(i);
- if ((av.getSelectionGroup() != null)
- && av.getSelectionGroup().getSequences(null).contains(seq))
- {
- currentColor = Color.gray;
- currentTextColor = Color.black;
- }
- else
- {
- currentColor = av.getSequenceColour(seq);
- currentTextColor = Color.black;
- }
-
- pg[G0].setColor(currentColor);
- pg[G0].fillRect(0, (i - startSeq) * av.getCharHeight(), idWidth,
- av.getCharHeight());
-
- pg[G0].setColor(currentTextColor);
-
- int xPos = 0;
- if (av.isRightAlignIds())
- {
- fm = pg[G0].getFontMetrics();
- xPos = idWidth
- - fm.stringWidth(seq.getDisplayId(av.getShowJVSuffix()))
- - 4;
- }
+ /*
+ * draw the Scale at horizontal offset, then reset to top left (0, 0)
+ */
+ alignmentGraphics.translate(alignmentGraphicsOffset, 0);
+ getScalePanel().drawScale(alignmentGraphics, startRes, endRes,
+ pageWidth - idWidth, scaleHeight);
+ alignmentGraphics.translate(-alignmentGraphicsOffset, 0);