From: amwaterhouse Date: Fri, 7 Jul 2006 13:06:29 +0000 (+0000) Subject: Row might have height of zero X-Git-Tag: Release_2_1~301 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=efbf36f3efcd7a971a6ca33d098f54b204f2cae9;p=jalview.git Row might have height of zero --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index ecd9370..bf1372e 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -278,13 +278,17 @@ public class AnnotationPanel extends JPanel implements MouseListener, */ public void mousePressed(MouseEvent evt) { - int height = 0; - activeRow = -1; + AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); if(aa==null) return; + + int height = 0; + activeRow = 0; + + for (int i = 0; i < aa.length; i++) { if (aa[i].visible) @@ -309,6 +313,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, } } + if (SwingUtilities.isRightMouseButton(evt)) { if (av.getColumnSelection() == null) @@ -862,6 +867,9 @@ public class AnnotationPanel extends JPanel implements MouseListener, column++; } + if(column>=row.annotations.length) + column = row.annotations.length-1; + x += av.charWidth; if (row.hasIcons)