Highlight from alignment
[jalview.git] / src / jalview / gui / SeqCanvas.java
index f86441a..97b9f08 100755 (executable)
@@ -65,7 +65,7 @@ public class SeqCanvas extends JComponent
         setBackground(Color.white);\r
     }\r
 \r
-    MCview.PDBCanvas pdbViewer;\r
+    MCview.PDBCanvas pdbCanvas;\r
     public SequenceRenderer getSequenceRenderer()\r
     {\r
       return sr;\r
@@ -76,9 +76,9 @@ public class SeqCanvas extends JComponent
       return fr;\r
     }\r
 \r
-    public void setPDBViewer(MCview.PDBCanvas pc)\r
+    public void setPDBCanvas(MCview.PDBCanvas pc)\r
     {\r
-      pdbViewer = pc;\r
+      pdbCanvas = pc;\r
     }\r
 \r
     public AlignViewport getViewport()\r
@@ -284,14 +284,16 @@ public class SeqCanvas extends JComponent
         sr.renderGaps(av.renderGaps);\r
 \r
         if ((img != null) &&\r
-                (fastPaint || (getWidth() != g.getClipBounds().width) ||\r
-                (getHeight() != g.getClipBounds().height)))\r
+                (fastPaint && getVisibleRect() != g.getClipBounds()))\r
         {\r
             g.drawImage(img, 0, 0, this);\r
             fastPaint = false;\r
             return;\r
         }\r
 \r
+\r
+\r
+\r
         // this draws the whole of the alignment\r
         imgWidth = getWidth();\r
         imgHeight = getHeight();\r
@@ -304,7 +306,6 @@ public class SeqCanvas extends JComponent
             return;\r
         }\r
 \r
-\r
         img = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB);\r
         gg = (Graphics2D) img.getGraphics();\r
         gg.setFont(av.getFont());\r
@@ -327,9 +328,9 @@ public class SeqCanvas extends JComponent
 \r
         g.drawImage(img, 0, 0, this);\r
 \r
-        if (pdbViewer != null)\r
+        if (pdbCanvas != null)\r
         {\r
-          pdbViewer.updateSeqColours();\r
+          pdbCanvas.updateSeqColours();\r
         }\r
 \r
     }\r