Adds check for gap padding to disallow fast paint upon pasting if
[jalview.git] / src / jalview / gui / SeqCanvas.java
index d1046f8..c99041b 100755 (executable)
@@ -287,6 +287,7 @@ public class SeqCanvas extends JPanel implements ViewportListenerI
    */
   public void fastPaint(int horizontal, int vertical)
   {
+
     // System.err.println("<<SeqCanvas fastPaint " + fastpainting + " "
     // + horizontal + " " + vertical);
     // effectively:
@@ -395,6 +396,10 @@ public class SeqCanvas extends JPanel implements ViewportListenerI
     int startSeq = ranges.getStartSeq();
     int endRes = ranges.getEndRes();
     int endSeq = ranges.getEndSeq();
+    if (av.isFastPaintDisabled())
+    {
+      fastPaint = false;
+    }
 
     // System.err.println(">>SeqCanvas paintComponent " + fastPaint + "\n"
     // + getVisibleRect() + "\n" + g.getClipBounds());
@@ -412,12 +417,11 @@ public class SeqCanvas extends JPanel implements ViewportListenerI
       drawSelectionGroup((Graphics2D) g, startRes, endRes, startSeq,
               endSeq);
       fastPaint = false;
-      //System.out.println("SeqCanvas fast paint");
+      // System.out.println("SeqCanvas fast paint");
     }
     else
     {
-
-      System.out.println("SeqCanvas full paint");
+      // System.out.println("SeqCanvas full paint");
       /*
        * img is a cached version of the last view we drew.
        * If we have no img or the size has changed, make a new one
@@ -2160,18 +2164,4 @@ public class SeqCanvas extends JPanel implements ViewportListenerI
     return labelWidthWest;
   }
 
-  /**
-   * Ensure that a full paint is done next, for whatever reason. This was
-   * necessary for JavaScript; apparently in Java the timing is just right on
-   * multiple threads (EventQueue-0, Consensus, Conservation) that we can get
-   * away with one fast paint before the others, but this ensures that in the
-   * end we get a full paint. Problem arose in relation to copy/paste, where the
-   * paste was not finalized with a full paint.
-   * 
-   * @author hansonr 2019.04.17
-   */
-  public void clearFastPaint()
-  {
-    fastPaint = false;
-  }
 }