int oldstartres = this.startRes;
if (start > getVisibleAlignmentWidth() - 1)
{
- startRes = getVisibleAlignmentWidth() - 1;
+ startRes = Math.max(getVisibleAlignmentWidth() - 1, 0);
}
else if (start < 0)
{
}
else if (end > getVisibleAlignmentWidth() - 1)
{
- endRes = getVisibleAlignmentWidth() - 1;
+ endRes = Math.max(getVisibleAlignmentWidth() - 1, 0);
}
else
{
int oldstartseq = this.startSeq;
if (start > getVisibleAlignmentHeight() - 1)
{
- startSeq = getVisibleAlignmentHeight() - 1;
+ startSeq = Math.max(getVisibleAlignmentHeight() - 1, 0);
}
else if (start < 0)
{
int oldendseq = this.endSeq;
if (end >= getVisibleAlignmentHeight())
{
- endSeq = getVisibleAlignmentHeight() - 1;
+ endSeq = Math.max(getVisibleAlignmentHeight() - 1, 0);
}
else if (end < 0)
{
ColumnSelection sel = new ColumnSelection();
al.getHiddenColumns().revealAllHiddenColumns(sel);
al.getHiddenSequences().showAll(null);
+ smallAl.getHiddenColumns().revealAllHiddenColumns(sel);
+ smallAl.getHiddenSequences().showAll(null);
}
@Test(groups = { "Functional" })
ViewportRanges vrsmall = new ViewportRanges(smallAl);
vrsmall.setStartEndRes(al.getWidth(), al.getWidth());
assertEquals(vrsmall.getEndRes(), 6);
+
+ // make visible alignment width = 0
+ smallAl.getHiddenColumns().hideColumns(0, 6);
+ vrsmall.setStartEndRes(0, 4);
+ assertEquals(vrsmall.getStartRes(), 0);
+ assertEquals(vrsmall.getEndRes(), 0);
}
@Test(groups = { "Functional" })
vr.setStartEndSeq(al.getHeight(), al.getHeight());
assertEquals(vr.getEndSeq(), al.getHeight() - 1);
+
+ // make visible alignment height = 0
+ smallAl.getHiddenSequences().hideSequence(smallAl.getSequenceAt(0));
+ smallAl.getHiddenSequences().hideSequence(smallAl.getSequenceAt(0));
+ ViewportRanges vrsmall = new ViewportRanges(smallAl);
+ vrsmall.setStartEndSeq(0, 3);
+ assertEquals(vrsmall.getStartSeq(), 0);
+ assertEquals(vrsmall.getEndSeq(), 0);
}
@Test(groups = { "Functional" })