// 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
- if ((offy * rowSize == oldX) && (oldwidth == rowSize))
+ int newX = offy * rowSize;
+ if ((newX == oldX) && (oldwidth == rowSize))
{
return;
}
else if (offy > -1)
{
- vpRanges.setViewportStartAndWidth(offy * rowSize, rowSize);
+ /*
+ * 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);
}
}
else