JAL-2600 updates following review
[jalview.git] / src / jalview / appletgui / IdCanvas.java
index cad5de5..5313b41 100755 (executable)
@@ -221,7 +221,8 @@ public class IdCanvas extends Panel implements ViewportListenerI
 
       if (av.hasHiddenColumns())
       {
-        maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
+        maxwidth = av.getAlignment().getHiddenColumns()
+                .findColumnPosition(maxwidth) - 1;
       }
 
       int annotationHeight = 0;
@@ -401,8 +402,12 @@ public class IdCanvas extends Panel implements ViewportListenerI
   public void propertyChange(PropertyChangeEvent evt)
   {
     // Respond to viewport range changes (e.g. alignment panel was scrolled)
-    if (evt.getPropertyName().equals("startseq")
-            || evt.getPropertyName().equals("endseq"))
+    // Both scrolling and resizing change viewport ranges: scrolling changes
+    // both start and end points, but resize only changes end values.
+    // Here we only want to fastpaint on a scroll, with resize using a normal
+    // paint, so scroll events are identified as changes to the horizontal or
+    // vertical start value.
+    if (evt.getPropertyName().equals(ViewportRanges.STARTSEQ))
     {
       fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
     }