Merge branch 'develop' into task/JAL-4001_migrate_googleanalytics_to_GA4
[jalview.git] / src / jalview / gui / TreeCanvas.java
index efa23bd..55ce44a 100755 (executable)
@@ -1148,14 +1148,22 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
     if (aa != null)
     {
       ContactMatrixI cm = av.getContactMatrix(aa);
+      // generally, we assume cm has 1:1 mapping to annotation row - probably wrong
+      // but.. if
       if (cm instanceof MappableContactMatrixI)
       {
+        int[] pos;
+          // use the mappable's mapping - always the case for PAE Matrices so good
+        // for 2.11.3
         MappableContactMatrixI mcm = (MappableContactMatrixI) cm;
-        int pos[]=mcm.getMappedPositionsFor(rseq, colm+1);
-        if (pos!=null)
+        pos = mcm.getMappedPositionsFor(rseq, colm + 1);
+        // finally, look up the position of the column
+        if (pos != null)
         {
-          offp=rseq.findIndex(pos[0]);
+          offp = rseq.findIndex(pos[0]);
         }
+      } else {
+        offp = colm;
       }
     }
     if (offp<=0)
@@ -1262,6 +1270,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         }
       }
     }
+    PaintRefresher.Refresh(tp, av.getSequenceSetId());
   }
 
   public void createSeqGroupFor(AlignmentPanel[] aps, Vector<BinaryNode> l,