- int offy = vscroll.getValue();
- int rowSize = getSeqPanel().seqCanvas
- .getWrappedCanvasWidth(getSeqPanel().seqCanvas.getWidth());
-
- // if we're scrolling to the position we're already at, stop
- // this prevents infinite recursion of events when the scroll/viewport
- // ranges values are the same
- int newX = offy * rowSize;
- if ((newX == oldX) && (oldwidth == rowSize))
- {
- return;
- }
- else if (offy > -1)
- {
- /*
- * throttle to one width's worth at a time (so click in
- * scrollbar doesn't jump over data)
- */
- newX = newX > oldX ? oldX + rowSize : oldX - rowSize;
- vpRanges.setViewportStartAndWidth(newX, rowSize);
- }