attempt to make fastPaint method thread safe
[jalview.git] / src / jalview / gui / SeqCanvas.java
index 389da75..cd7c231 100755 (executable)
@@ -209,15 +209,20 @@ public class SeqCanvas
       }
     }
   }
-
+  boolean fastpainting=false;
   /**
-   * DOCUMENT ME!
-   *
-   * @param horizontal DOCUMENT ME!
-   * @param vertical DOCUMENT ME!
+   * need to make this thread safe
+   * move alignment rendering in response to slider adjustment
+   * @param horizontal shift along
+   * @param vertical shift up or down in repaint
    */
   public void fastPaint(int horizontal, int vertical)
   {
+    if (fastpainting)
+    {
+      return;
+    }
+    fastpainting=true;
     if (gg == null)
     {
       return;
@@ -277,6 +282,7 @@ public class SeqCanvas
     gg.translate( -transX, -transY);
 
     repaint();
+    fastpainting=false;
   }
 
   /**