JAL-2600 updates following review
[jalview.git] / src / jalview / gui / IdCanvas.java
index a8f3b24..4642741 100755 (executable)
@@ -524,13 +524,14 @@ public class IdCanvas extends JPanel implements ViewportListenerI
   public void propertyChange(PropertyChangeEvent evt)
   {
     // Respond to viewport range changes (e.g. alignment panel was scrolled)
-    if (evt.getPropertyName().equals("startseq"))
+    // 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());
     }
-    else if (evt.getPropertyName().equals("endseq"))
-    {
-      // resize - do nothing
-    }
   }
 }