Merge branch 'releases/Release_2_10_4_Branch' into develop
[jalview.git] / src / jalview / gui / IdCanvas.java
index 1ee281a..cd7b0b7 100755 (executable)
@@ -83,7 +83,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     this.av = av;
     PaintRefresher.Register(this, av.getSequenceSetId());
     av.getRanges().addPropertyChangeListener(this);
-  }
+    }
 
   /**
    * DOCUMENT ME!
@@ -205,7 +205,10 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
     fastPaint = true;
 
-    av.getAlignPanel().alignFrame.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();
   }
 
   /**
@@ -242,8 +245,8 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     
     if (oldHeight != imgHeight || image.getWidth(this) != getWidth())
     {
-      image = new BufferedImage(getWidth(), imgHeight,
-              BufferedImage.TYPE_INT_RGB);
+       image = new BufferedImage(getWidth(), imgHeight,
+                BufferedImage.TYPE_INT_RGB);
     }
     
     gg = (Graphics2D) image.getGraphics();
@@ -377,7 +380,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     if (av.hasHiddenColumns())
     {
       maxwidth = av.getAlignment().getHiddenColumns()
-              .findColumnPosition(maxwidth) - 1;
+              .absoluteToVisibleColumn(maxwidth) - 1;
     }
 
     int annotationHeight = 0;
@@ -572,5 +575,9 @@ public class IdCanvas extends JPanel implements ViewportListenerI
       fastPaint(((int[]) evt.getNewValue())[1]
               - ((int[]) evt.getOldValue())[1]);
     }
+    else if (propertyName.equals(ViewportRanges.MOVE_VIEWPORT))
+    {
+      repaint();
+    }
   }
 }