From 8de3a0423c4478b968835acb7987d7bd881d3738 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 5 Sep 2017 15:40:41 +0100 Subject: [PATCH] JAL-2665 check for null selection group image --- src/jalview/gui/SeqCanvas.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); + } } /** -- 1.7.10.2