JAL-2600 updates following review
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index 1ba04b4..61099c3 100755 (executable)
@@ -31,6 +31,7 @@ import jalview.schemes.ResidueProperties;
 import jalview.util.Comparison;
 import jalview.util.MessageManager;
 import jalview.viewmodel.ViewportListenerI;
+import jalview.viewmodel.ViewportRanges;
 
 import java.awt.AlphaComposite;
 import java.awt.Color;
@@ -1170,13 +1171,14 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   public void propertyChange(PropertyChangeEvent evt)
   {
     // Respond to viewport range changes (e.g. alignment panel was scrolled)
-    if (evt.getPropertyName().equals("startres"))
+    // 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.STARTRES))
     {
       fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
     }
-    else if (evt.getPropertyName().equals("endres"))
-    {
-      // resize - do nothing
-    }
   }
 }