import jalview.io.DataSourceType;
import jalview.io.FileLoader;
import jalview.util.MessageManager;
+import jalview.viewmodel.ViewportRanges;
-import java.awt.event.InputEvent;import java.awt.EventQueue;
+import java.awt.EventQueue;
import java.awt.event.MouseEvent;
import java.lang.reflect.InvocationTargetException;
int x = 0;
final int charWidth = alignFrame.getViewport().getCharWidth();
assertTrue(charWidth > 0); // sanity check
- assertEquals(alignFrame.getViewport().getRanges().getStartRes(), 0);
+ ViewportRanges ranges = alignFrame.getViewport().getRanges();
+ assertEquals(ranges.getStartRes(), 0);
/*
* mouse at top left of unwrapped panel
false, 0);
SeqCanvas seqCanvas = alignFrame.alignPanel.getSeqPanel().seqCanvas;
int w = seqCanvas.getWidth();
- // limited to number of whole columns, base 0
- int expected = w / charWidth - 1;
+ // limited to number of whole columns, base 0,
+ // and to end of visible range
+ int expected = w / charWidth;
+ expected = Math.min(expected, ranges.getEndRes());
assertEquals(testee.findColumn(evt), expected);
/*