From 465a6cd845df09406c71ffbe760d0df4dbeb803d Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 20 Oct 2017 08:44:17 +0100 Subject: [PATCH] JAL-2609 fully erase scale above, tidy code change --- src/jalview/gui/SeqCanvas.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 6c6e87a..d82f69a 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -838,10 +838,12 @@ public class SeqCanvas extends JComponent implements ViewportListenerI * white fill region of scale above and hidden column markers * (to support incremental fast paint of image) */ + g.translate(labelWidthWest, 0); g.setColor(Color.white); g.fillRect(0, ypos - wrappedSpaceAboveAlignment, viewportWidth * charWidth + labelWidthWest, wrappedSpaceAboveAlignment); g.setColor(Color.black); + g.translate(-labelWidthWest, 0); g.translate(labelWidthWest, 0); @@ -1666,7 +1668,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI // larger than the visible window ViewportRanges vpRanges = av.getRanges(); scrollX = (int) evt.getNewValue() - (int) evt.getOldValue(); - int range = vpRanges.getEndRes() - vpRanges.getStartRes() + 1; + int range = vpRanges.getViewportWidth(); if (scrollX > range) { scrollX = range; -- 1.7.10.2