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

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

@@@ -409,14 -417,30 +417,33 @@@ public class SeqPanel extends JPane
      }
      else
      {
-       av.getRanges().scrollToVisible(seqCanvas.cursorX, seqCanvas.cursorY);
+       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
+       {
+         av.getRanges().scrollToVisible(seqCanvas.cursorX,
+                 seqCanvas.cursorY);
+       }
      }
-     setStatusMessage(av.getAlignment().getSequenceAt(seqCanvas.cursorY),
+     if (av.getAlignment().getHiddenColumns().isVisible(seqCanvas.cursorX))
+     {
+       setStatusMessage(av.getAlignment().getSequenceAt(seqCanvas.cursorY),
              seqCanvas.cursorX, seqCanvas.cursorY);
+     }
  
-     seqCanvas.repaint();
+     if (repaintNeeded)
+     {
+       seqCanvas.repaint();
+     }
    }
  
    void setSelectionAreaAtCursor(boolean topLeft)
    {
      SequenceI sequence = av.getAlignment().getSequenceAt(seqCanvas.cursorY);