Merge branch 'feature/JAL-2759' into merge/JAL-2759_2104
[jalview.git] / src / jalview / gui / ScalePanel.java
index f772a1f..e6bba02 100755 (executable)
@@ -410,6 +410,8 @@ public class ScalePanel extends JPanel
   @Override
   public void paintComponent(Graphics g)
   {
+    super.paintComponent(g);
+
     /*
      * shouldn't get called in wrapped mode as the scale above is
      * drawn instead by SeqCanvas.drawNorthScale
@@ -550,7 +552,11 @@ public class ScalePanel extends JPanel
             || evt.getPropertyName().equals(ViewportRanges.MOVE_VIEWPORT))
     {
       // scroll event, repaint panel
-      repaint();
+       
+       // Call repaint on alignment panel so that repaints from other alignment
+    // panel components can be aggregated. Otherwise performance of the overview
+    // window and others may be adversely affected.
+      av.getAlignPanel().repaint();
     }
   }