From efbf36f3efcd7a971a6ca33d098f54b204f2cae9 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 7 Jul 2006 13:06:29 +0000 Subject: [PATCH] Row might have height of zero --- src/jalview/gui/AnnotationPanel.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) -- 1.7.10.2