X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;fp=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=921429b5a24ba1f3d0f08d13c2b32acb1ecab175;hb=4f30cce34289ac0c2dee7b65218f8b98a6a63172;hp=65546556e218a42f45c4c4bb2f7bc80d46cf1294;hpb=608282e79f4dd02c92565235b7946265bdca847d;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 6554655..921429b 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1062,7 +1062,7 @@ public class AlignmentPanel extends GAlignmentPanel implements + 3; /* - * draw the Scale at horizontal offset, then reset to origin + * draw the Scale at horizontal offset, then reset to top left (0, 0) */ alignmentGraphics.translate(alignmentGraphicsOffset, 0); getScalePanel().drawScale(alignmentGraphics, startRes, endRes, @@ -1071,7 +1071,7 @@ public class AlignmentPanel extends GAlignmentPanel implements /* * Draw the sequence ids, offset for scale height, - * then reset to origin + * then reset to top left (0, 0) */ idGraphics.translate(0, scaleHeight); idGraphics.setFont(getIdPanel().getIdCanvas().getIdfont()); @@ -1122,7 +1122,7 @@ public class AlignmentPanel extends GAlignmentPanel implements /* * draw the sequences, offset for scale height, and id width (if using a - * single graphics context), then reset to origin + scale height + * single graphics context), then reset to (0, scale height) */ alignmentGraphics.translate(alignmentGraphicsOffset, scaleHeight); getSeqPanel().seqCanvas.drawPanel(alignmentGraphics, startRes, endRes, @@ -1132,16 +1132,19 @@ public class AlignmentPanel extends GAlignmentPanel implements if (av.isShowAnnotation() && (endSeq == alignmentHeight)) { /* - * draw annotation labels, offset for current scroll position - * then reset to origin + scale height + * 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 + alignmentDrawnHeight); + int offset = getAlabels().getScrollOffset(); + idGraphics.translate(0, -offset); + idGraphics.translate(0, alignmentDrawnHeight); getAlabels().drawComponent(idGraphics, idWidth); - idGraphics.translate(0, -offset - alignmentDrawnHeight); + idGraphics.translate(0, -alignmentDrawnHeight); /* - * draw the annotations + * draw the annotations starting at + * (idOffset, alignmentHeight) from (0, scaleHeight) */ alignmentGraphics.translate(alignmentGraphicsOffset, alignmentDrawnHeight); getAnnotationPanel().renderer.drawComponent(getAnnotationPanel(), av,