{
return;
}
- else if (newY > -1)
+ if (newY > -1)
{
/*
* limit page up/down to one width's worth of positions
*/
int rowSize = vpRanges.getViewportWidth();
int newX = newY > oldY ? oldX + rowSize : oldX - rowSize;
- vpRanges.setViewportStartAndWidth(newX, rowSize);
+ vpRanges.setViewportStartAndWidth(Math.max(0, newX), rowSize);
}
}
else
{
return;
}
- else if (newY > -1)
+ if (newY > -1)
{
/*
* limit page up/down to one width's worth of positions
*/
int rowSize = vpRanges.getViewportWidth();
int newX = newY > oldY ? oldX + rowSize : oldX - rowSize;
- vpRanges.setViewportStartAndWidth(newX, rowSize);
+ vpRanges.setViewportStartAndWidth(Math.max(0, newX), rowSize);
}
}
else