Row might have height of zero
authoramwaterhouse <Andrew Waterhouse>
Fri, 7 Jul 2006 13:06:29 +0000 (13:06 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 7 Jul 2006 13:06:29 +0000 (13:06 +0000)
src/jalview/gui/AnnotationPanel.java

index ecd9370..bf1372e 100755 (executable)
@@ -278,13 +278,17 @@ public class AnnotationPanel extends JPanel implements MouseListener,
      */\r
     public void mousePressed(MouseEvent evt)\r
     {\r
-        int height = 0;\r
-        activeRow = -1;\r
+\r
 \r
         AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
         if(aa==null)\r
           return;\r
 \r
+\r
+        int height = 0;\r
+        activeRow = 0;\r
+\r
+\r
         for (int i = 0; i < aa.length; i++)\r
         {\r
             if (aa[i].visible)\r
@@ -309,6 +313,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
             }\r
         }\r
 \r
+\r
         if (SwingUtilities.isRightMouseButton(evt))\r
         {\r
             if (av.getColumnSelection() == null)\r
@@ -862,6 +867,9 @@ public class AnnotationPanel extends JPanel implements MouseListener,
                 column++;\r
             }\r
 \r
+            if(column>=row.annotations.length)\r
+              column = row.annotations.length-1;\r
+\r
             x += av.charWidth;\r
 \r
             if (row.hasIcons)\r