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_2b1~7^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dda77016b864ec689d98677ca6848e1e92420e44;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 3d8b8aa..d434ba8 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -437,12 +437,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); + } } /**