From 6f3a49cde6acd06f8f53c39f9fdc4f61746ec3fa Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 7 Aug 2017 16:28:41 +0200 Subject: [PATCH] JAL-2609 clear sequence/annotation region before rendering --- src/jalview/gui/SeqCanvas.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 7eb356b..9ebf377 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -628,8 +628,8 @@ public class SeqCanvas extends JComponent implements ViewportListenerI /* * move right before drawing by the width of the scale left (if any) - * plus column offset from left margin (usually zero, but may not be - * when fast painting draws just a few columns) + * plus column offset from left margin (usually zero, but may be non-zero + * when fast painting is drawing just a few columns) */ int xOffset = labelWidthWest + ((startColumn - ranges.getStartRes()) % viewportWidth) @@ -650,6 +650,14 @@ public class SeqCanvas extends JComponent implements ViewportListenerI viewportWidth * charWidth, (int) clip.getBounds().getHeight()); } + /* + * white fill the region to be drawn (so incremental fast paint doesn't + * scribble over an existing image) + */ + gg.setColor(Color.white); + gg.fillRect(0, ypos, (endx - startColumn + 1) * charWidth, + wrappedRepeatHeightPx); + drawPanel(g, startColumn, endx, 0, av.getAlignment().getHeight() - 1, ypos); -- 1.7.10.2