PaintRefresh changed
[jalview.git] / src / jalview / gui / SeqCanvas.java
index 1194d08..789fb3f 100755 (executable)
@@ -44,13 +44,15 @@ public class SeqCanvas
   int LABEL_WEST;\r
   int LABEL_EAST;\r
 \r
+\r
   public SeqCanvas(AlignViewport av)\r
   {\r
     this.av = av;\r
     fr = new FeatureRenderer(av);\r
     sr = new SequenceRenderer(av);\r
     setLayout(new BorderLayout());\r
-    PaintRefresher.Register(this);\r
+    PaintRefresher.Register(this, av.alignment);\r
+    setBackground(Color.white);\r
   }\r
 \r
   void drawNorthScale(Graphics g, int startx, int endx, int ypos)\r
@@ -212,16 +214,16 @@ public class SeqCanvas
    * NOTE 1: The av limits are set in setFont in this class and\r
    * in the adjustment listener in SeqPanel when the scrollbars move.\r
    */\r
+\r
+\r
+  // Set this to false to force a full panel paint\r
   public void paintComponent(Graphics g)\r
   {\r
-    g.setColor(Color.white);\r
-    g.fillRect(0, 0, getWidth(), getHeight());\r
-\r
-    if (fastPaint)\r
+    if (fastPaint  ||  getWidth() !=  g.getClipBounds().width\r
+                   ||  getHeight() != g.getClipBounds().height)\r
     {\r
       g.drawImage(img, 0, 0, this);\r
       fastPaint = false;\r
-\r
       return;\r
     }\r
 \r