JAL-2842 remove infinite loop in cursor move bug/JAL-2842
authorkiramt <k.mourao@dundee.ac.uk>
Thu, 16 Nov 2017 09:12:06 +0000 (09:12 +0000)
committerkiramt <k.mourao@dundee.ac.uk>
Thu, 16 Nov 2017 09:12:06 +0000 (09:12 +0000)
src/jalview/gui/SeqPanel.java

index 2223ee5..dbbf510 100644 (file)
@@ -363,8 +363,11 @@ public class SeqPanel extends JPanel
       int original = seqCanvas.cursorX - dx;
       int maxWidth = av.getAlignment().getWidth();
 
+      // TODO: once JAL-2759 is ready, change this loop to something more
+      // efficient
       while (!hidden.isVisible(seqCanvas.cursorX)
-              && seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0)
+              && seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0
+              && dx != 0)
       {
         seqCanvas.cursorX += dx;
       }