Merge branch 'develop' into releases/Release_2_11_2_Branch
[jalview.git] / src / jalview / gui / OverviewCanvas.java
index 0f49381..470fd64 100644 (file)
@@ -32,9 +32,9 @@ import java.awt.Dimension;
 import java.awt.Graphics;
 import java.awt.image.BufferedImage;
 
-import javax.swing.JComponent;
+import javax.swing.JPanel;
 
-public class OverviewCanvas extends JComponent
+public class OverviewCanvas extends JPanel
 {
   private static final Color TRANS_GREY = new Color(100, 100, 100, 25);
 
@@ -182,7 +182,7 @@ public class OverviewCanvas extends JComponent
   @Override
   public void paintComponent(Graphics g)
   {
-    super.paintComponent(g);
+    // super.paintComponent(g);
 
     if (restart)
     {
@@ -207,7 +207,8 @@ public class OverviewCanvas extends JComponent
       {
         // if there is annotation, scale the alignment and annotation
         // separately
-        if (od.getGraphHeight() > 0)
+        if (od.getGraphHeight() > 0 && od.getSequencesHeight() > 0 // BH 2019
+        )
         {
           BufferedImage topImage = lastMiniMe.getSubimage(0, 0,
                   od.getWidth(), od.getSequencesHeight());
@@ -248,13 +249,12 @@ public class OverviewCanvas extends JComponent
     {
       g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
     }
-    
+
     // draw the box
     g.setColor(Color.red);
     od.drawBox(g);
   }
 
-
   public void dispose()
   {
     dispose = true;