From eb86f84d1835ee5be41ebfef365a9e11021c16c2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 7 Aug 2017 16:04:38 +0200 Subject: [PATCH] JAL-2609 erase scale above before drawing scale/hidden markers --- src/jalview/gui/SeqCanvas.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index efc6910..7eb356b 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -531,7 +531,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI start += wrappedWidthInResidues; } - drawWrappedDecorators(g, canvasHeight, startColumn); + drawWrappedDecorators(g, startColumn); } /** @@ -673,15 +673,12 @@ public class SeqCanvas extends JComponent implements ViewportListenerI /** * Draws scales left, right and above (if shown), and any hidden column - * markers, on the wrapped alignment + * markers, on all widths of the wrapped alignment * * @param g - * @param ypos * @param startColumn - * @param endColumn */ - protected void drawWrappedDecorators(Graphics g, int canvasHeight, - int startColumn) + protected void drawWrappedDecorators(Graphics g, int startColumn) { g.setFont(av.getFont()); g.setColor(Color.black); @@ -707,6 +704,15 @@ public class SeqCanvas extends JComponent implements ViewportListenerI g.translate(labelWidthWest, 0); + /* + * white fill region of scale above and hidden column markers + * (to support incremental fast paint of image) + */ + g.setColor(Color.white); + g.fillRect(0, ypos - wrappedSpaceAboveAlignment, viewportWidth + * charWidth, wrappedSpaceAboveAlignment); + g.setColor(Color.black); + if (av.getScaleAboveWrapped()) { drawNorthScale(g, startColumn, endColumn, ypos); @@ -1406,7 +1412,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI /* * draw all scales (if shown) and hidden column markers */ - drawWrappedDecorators(gg, getHeight(), ranges.getStartRes()); + drawWrappedDecorators(gg, ranges.getStartRes()); repaint(); } finally -- 1.7.10.2