Merge branch 'develop' into bug/JAL-2837 bug/JAL-2837
authorkiramt <k.mourao@dundee.ac.uk>
Fri, 17 Nov 2017 12:14:59 +0000 (12:14 +0000)
committerkiramt <k.mourao@dundee.ac.uk>
Fri, 17 Nov 2017 12:14:59 +0000 (12:14 +0000)
Conflicts:
src/jalview/gui/SeqPanel.java

src/jalview/gui/SeqPanel.java
src/jalview/viewmodel/ViewportRanges.java

index e11af48..2cdb1d8 100644 (file)
@@ -419,7 +419,10 @@ public class SeqPanel extends JPanel
     {
       if (av.getWrapAlignment())
       {
-        av.getRanges().scrollToWrappedVisible(seqCanvas.cursorX);
+        // scrollToWrappedVisible expects x-value to have hidden cols subtracted
+        int x = av.getAlignment().getHiddenColumns()
+                .findColumnPosition(seqCanvas.cursorX);
+        av.getRanges().scrollToWrappedVisible(x);
       }
       else
       {
index 0cc8d7c..c7a3fa1 100644 (file)
@@ -544,7 +544,8 @@ public class ViewportRanges extends ViewportProperties
    * the startRes changed, else false.
    * 
    * @param res
-   *          residue position to scroll to
+   *          residue position to scroll to NB visible position not absolute
+   *          alignment position
    * @return
    */
   public boolean scrollToWrappedVisible(int res)
@@ -592,9 +593,9 @@ public class ViewportRanges extends ViewportProperties
    * Scroll so that (x,y) is visible. Fires a property change event.
    * 
    * @param x
-   *          x position in alignment
+   *          x position in alignment (absolute position)
    * @param y
-   *          y position in alignment
+   *          y position in alignment (absolute position)
    */
   public void scrollToVisible(int x, int y)
   {