From 16eb01c0d83f94f2c1065b6688166d8624529fa2 Mon Sep 17 00:00:00 2001 From: kiramt Date: Thu, 16 Nov 2017 09:12:06 +0000 Subject: [PATCH] JAL-2842 remove infinite loop in cursor move --- src/jalview/gui/SeqPanel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 1.7.10.2