if (horizontal > 0) // scrollbar pulled right, image to the left
{
- er++;
transX = (er - sr - horizontal) * charWidth;
sr = er - horizontal;
}
else if (horizontal < 0)
{
- er = sr - horizontal - 1;
+ er = sr - horizontal;
}
else if (vertical > 0) // scroll down
{
setStartRes((res / width) * width);
}
- // pass av here until hidden columns JAL-2388 merged, then use alignment
- // instead
+ /**
+ * Scroll so that (x,y) is visible
+ *
+ * @param x
+ * x position in alignment
+ * @param y
+ * y position in alignment
+ * @param av
+ * viewport to be visible in. Here until hidden columns JAL-2388
+ * merged, then use alignment to get hidden cols
+ */
public void scrollToVisible(int x, int y, AlignViewportI av)
{
while (y < startSeq)
{
scrollUp(true);
}
- while (y + 1 > endSeq)
+ while (y > endSeq)
{
scrollUp(false);
}