JAL-2609 tweaks including fully erasing scale above
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 21 Aug 2017 14:53:18 +0000 (15:53 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 21 Aug 2017 14:53:18 +0000 (15:53 +0100)
src/jalview/gui/SeqCanvas.java

index 088a359..46f2d84 100755 (executable)
@@ -709,17 +709,17 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
         drawVerticalScale(g, startColumn, endColumn, ypos, false);
       }
 
-      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);
+              * charWidth + labelWidthWest, wrappedSpaceAboveAlignment);
       g.setColor(Color.black);
 
+      g.translate(labelWidthWest, 0);
+
       if (av.getScaleAboveWrapped())
       {
         drawNorthScale(g, startColumn, endColumn, ypos);
@@ -1456,7 +1456,7 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
 
     if (lastWidthPartHeight)
     {
-      int widthsAbove = visibleWidths - 2;
+      int widthsAbove = Math.max(0, visibleWidths - 2);
       int ypos = wrappedRepeatHeightPx * widthsAbove
               + wrappedSpaceAboveAlignment;
       int endRes = ranges.getEndRes();