stop flickering annotationPanel
authoramwaterhouse <Andrew Waterhouse>
Mon, 5 Feb 2007 11:58:42 +0000 (11:58 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 5 Feb 2007 11:58:42 +0000 (11:58 +0000)
src/jalview/appletgui/AnnotationPanel.java

index 172211e..17c0c8a 100755 (executable)
@@ -225,6 +225,7 @@ public class AnnotationPanel
       fastPaint = false;\r
     }\r
 \r
+\r
     if (fastPaint)\r
     {\r
       g.drawImage(image, 0, 0, this);\r
@@ -232,7 +233,11 @@ public class AnnotationPanel
       return;\r
     }\r
 \r
+    gg.setColor(Color.white);\r
+    gg.fillRect(0, 0, getSize().width, getSize().height);\r
     drawComponent(gg, av.startRes, av.endRes + 1);\r
+\r
+\r
     g.drawImage(image, 0, 0, this);\r
   }\r
 \r
@@ -281,13 +286,15 @@ public class AnnotationPanel
   {\r
     g.setFont(av.getFont());\r
 \r
+\r
+    g.setColor(Color.white);\r
+    g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getSize().height);\r
+\r
+\r
     if (fm == null)\r
       fm = g.getFontMetrics();\r
 \r
 \r
-      g.setColor(Color.white);\r
-      g.fillRect(0, 0, getSize().width, getSize().height);\r
-\r
       if ((av.alignment.getAlignmentAnnotation() == null) ||\r
               (av.alignment.getAlignmentAnnotation().length < 1))\r
       {\r