X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqCanvas.java;h=4e896a0d9b7745b71a8a0614dc08ade86916b967;hb=cef8dbc4cf7c8b47864b11aad36596901003639a;hp=05cc6a9cd025be7d5b12dbfbc40b1d9a52ca70df;hpb=b5a209613f14ad6e75f43aa537a96484d847ce0a;p=jalview.git diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 05cc6a9..4e896a0 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -283,7 +283,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI */ public void fastPaint(int horizontal, int vertical) { - if (fastpainting || gg == null) + if (fastpainting || gg == null || img == null) { return; } @@ -429,12 +429,16 @@ public class SeqCanvas extends JComponent implements ViewportListenerI public void drawPanelForPrinting(Graphics g1, int startRes, int endRes, int startSeq, int endSeq) { + drawPanel(g1, startRes, endRes, startSeq, endSeq, 0); + BufferedImage selectImage = drawSelectionGroup(startRes, endRes, startSeq, endSeq); - drawPanel(g1, startRes, endRes, startSeq, endSeq, 0); - ((Graphics2D) g1).setComposite( - AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); - g1.drawImage(selectImage, 0, 0, this); + if (selectImage != null) + { + ((Graphics2D) g1).setComposite(AlphaComposite + .getInstance(AlphaComposite.SRC_OVER)); + g1.drawImage(selectImage, 0, 0, this); + } } /** @@ -765,7 +769,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI hgap += charHeight; } - int cWidth = (canvasWidth - LABEL_EAST - LABEL_WEST) / charWidth; + int cWidth = (canvasWidth - labelWidthEast - labelWidthWest) + / charWidth; int cHeight = av.getAlignment().getHeight() * charHeight; int startx = startRes; @@ -791,13 +796,13 @@ public class SeqCanvas extends JComponent implements ViewportListenerI endx = maxwidth; } - g.translate(LABEL_WEST, 0); + g.translate(labelWidthWest, 0); drawUnwrappedSelection(g, group, startx, endx, 0, av.getAlignment().getHeight() - 1, ypos); - g.translate(-LABEL_WEST, 0); + g.translate(-labelWidthWest, 0); // update vertical offset ypos += cHeight + getAnnotationHeight() + hgap; @@ -829,6 +834,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI * marker. * * @param g1 + * Graphics object to draw with * @param startRes * offset of the first column in the visible region (0..) * @param endRes