From: gmungoc Date: Tue, 5 Sep 2017 14:40:41 +0000 (+0100) Subject: JAL-2665 check for null selection group image X-Git-Tag: Release_2_10_3b1~139 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8de3a0423c4478b968835acb7987d7bd881d3738;p=jalview.git JAL-2665 check for null selection group image --- diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index d04d6f3..191a7d8 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -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); + } } /**