ScrollRect update

MaysonG@aol.com
Thu, 7 Nov 1996 10:58:10 -0500

A slightly more robust version (it rounds to the nearest pixel) of my
ScrollRect utility routine:

PROCEDURE ScrollRect (f: Views.Frame; dx, dy, l, t, r, b: LONGINT);
VAR
ll, tt, rr, bb: LONGINT;
BEGIN
ASSERT (l >=f.l, 20); ASSERT (t >=f.t, 21); ASSERT (r <=f.r, 22); ASSERT
(b <=f.b, 23);
ASSERT (l < r, 24); ASSERT (t < b, 25);
ll := f.rider.l; tt := f.rider.t ; rr := f.rider.r; bb := f.rider.b;
f.rider.Set(f.rider.l + ((l - f.l) DIV f.dot), f.rider.t + ((t - f.t) DIV
f.dot),
f.rider.r + ((r - f.r) DIV f.dot), f.rider.b + ((b - f.b) DIV
f.dot));
dx := dx + (f.dot DIV 2);
dy := dy + (f.dot DIV 2);
dx := dx - (dx MOD f.dot);
dy := dy - (dy MOD f.dot);
f.Scroll(dx, dy);
f.rider.Set(ll, tt, rr, bb);
END ScrollRect;