From: kiramt Date: Thu, 16 Nov 2017 09:12:06 +0000 (+0000) Subject: JAL-2842 remove infinite loop in cursor move X-Git-Tag: Release_2_10_3b1~5^2~8^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-2842;p=jalview.git JAL-2842 remove infinite loop in cursor move --- diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 2223ee5..dbbf510 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -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; }