X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=ea8fcdcd0b6821c09bf135161e6e97acfdb8fa28;hp=92b9a5065cd1b64168b5eb2ffa4a4b0a40023d33;hb=bb2a4bd95f124f66f7c9722d16cede26b2f45dc0;hpb=16d109024847af92482237e43f99b82fd997451a diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 92b9a50..ea8fcdc 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1052,6 +1052,8 @@ public class AlignmentPanel extends GAlignmentPanel implements public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber, Graphics g) throws PrinterException { + getSeqPanel().seqCanvas.calculateWrappedGeometry(getWidth(), + getHeight()); int annotationHeight = 0; if (av.isShowAnnotation()) { @@ -1073,6 +1075,7 @@ public class AlignmentPanel extends GAlignmentPanel implements int resWidth = getSeqPanel().seqCanvas .getWrappedCanvasWidth(pageWidth - idWidth); + av.getRanges().setViewportStartAndWidth(0, resWidth); int totalHeight = cHeight * (maxwidth / resWidth + 1); @@ -1084,8 +1087,8 @@ public class AlignmentPanel extends GAlignmentPanel implements /* * method: print the whole wrapped alignment, but with a clip region that * is restricted to the requested page; this supports selective print of - * single pages or ranges, (at the cost of some repeated processing in - * the 'normal' case, when all pages are printed) + * single pages or ranges, (at the cost of repeated processing in the + * 'normal' case, when all pages are printed) */ g.translate(0, -pageNumber * pageHeight); @@ -1414,6 +1417,12 @@ public class AlignmentPanel extends GAlignmentPanel implements } + /** + * Answers the height of the entire alignment in pixels, assuming it is in + * wrapped mode + * + * @return + */ int getWrappedHeight() { int seqPanelWidth = getSeqPanel().seqCanvas.getWidth(); @@ -1438,6 +1447,7 @@ public class AlignmentPanel extends GAlignmentPanel implements int annotationHeight = 0; if (av.isShowAnnotation()) { + hgap += SeqCanvas.SEQS_ANNOTATION_GAP; annotationHeight = getAnnotationPanel().adjustPanelHeight(); }