int alignmentWidth = alignViewport.getAlignment().getWidth();
final int alheight = alignViewport.getAlignment().getHeight();
- int annotationHeight = 0;
+ /*
+ * assumption: SeqCanvas.calculateWrappedGeometry has been called
+ */
+ SeqCanvas seqCanvas = alignViewport.getAlignPanel()
+ .getSeqPanel().seqCanvas;
final int charHeight = alignViewport.getCharHeight();
- int hgap = charHeight;
- if (alignViewport.getScaleAboveWrapped())
- {
- hgap += charHeight;
- }
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
- hgap += SeqCanvas.SEQS_ANNOTATION_GAP;
- if (ap == null)
- {
- ap = new AnnotationPanel(alignViewport);
- }
- annotationHeight = ap.adjustPanelHeight();
labels = new AnnotationLabels(alignViewport);
}
- /*
- * height of alignment + gap + annotations (if shown)
- */
- int cHeight = alheight * charHeight + hgap
- + annotationHeight;
-
ViewportRanges ranges = alignViewport.getRanges();
int rowSize = ranges.getViewportWidth();
* out of visible space, whichever comes first
*/
boolean hasHiddenRows = alignViewport.hasHiddenRows();
- int ypos = hgap;
+ int ypos = seqCanvas.wrappedSpaceAboveAlignment;
int rowStartRes = ranges.getStartRes();
while ((ypos <= pageHeight) && (rowStartRes < alignmentWidth))
{
g.translate(0, -ypos - (alheight * charHeight));
}
- ypos += cHeight;
+ ypos += seqCanvas.wrappedRepeatHeightPx;
rowStartRes += rowSize;
}
}