{
endRes = 0;
}
+ else if (end > getVisibleAlignmentWidth() - 1)
+ {
+ endRes = getVisibleAlignmentWidth() - 1;
+ }
else
{
endRes = end;
{
vpstart = 0;
}
- else if (vpstart + w - 1 > getVisibleAlignmentWidth() - 1)
+ else if ((w <= getVisibleAlignmentWidth())
+ && (vpstart + w - 1 > getVisibleAlignmentWidth() - 1))
+ // viewport width is less than the full alignment and we are running off the
+ // RHS edge
{
- vpstart = getVisibleAlignmentWidth() - 1;
+ vpstart = getVisibleAlignmentWidth() - w;
}
setStartEndRes(vpstart, vpstart + w - 1);
}
{
vpstart = 0;
}
- else if (vpstart + h - 1 > getVisibleAlignmentHeight() - 1)
+ else if ((h <= getVisibleAlignmentHeight())
+ && (vpstart + h - 1 > getVisibleAlignmentHeight() - 1))
+ // viewport height is less than the full alignment and we are running off
+ // the bottom
{
vpstart = getVisibleAlignmentHeight() - h;
}
}
else
{
- if (endRes > getVisibleAlignmentWidth() - 1)
+ if (endRes >= getVisibleAlignmentWidth() - 1)
{
return false;
}