From 00918171094ad58563bd0b82e18ecf19537ba132 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 28 Jul 2017 17:23:46 +0200 Subject: [PATCH] JAL-2609 enabled (still broken/incomplete) fast paint --- src/jalview/gui/SeqCanvas.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 3b0d717..373389d 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -215,12 +215,16 @@ public class SeqCanvas extends JComponent implements ViewportListenerI * draw scale value, justified, with half a character width * separation from the sequence data */ - int justify = fm.stringWidth(String.valueOf(value)) + charWidth; + String valueAsString = String.valueOf(value); + int justify = fm.stringWidth(valueAsString) + charWidth; int xpos = left ? labelWidthWest - justify + charWidth / 2 : getWidth() - justify - charWidth / 2; - g.drawString(String.valueOf(value), xpos, (ypos + (i * charHeight)) - - (charHeight / 5)); + g.setColor(Color.white); + int y = (ypos + (i * charHeight)) - (charHeight / 5); + g.fillRect(xpos, y, justify, charHeight); + g.setColor(Color.black); + g.drawString(valueAsString, xpos, y); } } } @@ -1186,7 +1190,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI */ protected void fastPaintWrapped(int scrollX) { - if (Math.abs(scrollX) > 0 /*av.getRanges().getViewportWidth()*/) + if (Math.abs(scrollX) > av.getRanges().getViewportWidth()) { /* * shift of more than one view width is too much @@ -1299,11 +1303,11 @@ public class SeqCanvas extends JComponent implements ViewportListenerI if (av.getScaleLeftWrapped()) { - // drawVerticalScale(gg, xpos, xpos + viewportWidth, y, true); + drawVerticalScale(gg, xpos, xpos + viewportWidth, y, true); } if (av.getScaleRightWrapped()) { - // drawVerticalScale(gg, xpos, xpos + viewportWidth, y, false); + drawVerticalScale(gg, xpos, xpos + viewportWidth, y, false); } y += repeatHeight; -- 1.7.10.2