From: gmungoc Date: Fri, 28 Jul 2017 15:23:46 +0000 (+0200) Subject: JAL-2609 enabled (still broken/incomplete) fast paint X-Git-Tag: Release_2_10_3b1~91^2~6^2~29 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=00918171094ad58563bd0b82e18ecf19537ba132;p=jalview.git JAL-2609 enabled (still broken/incomplete) fast paint --- 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;