BiScrollersExtras.Mesa
Last tweaked by Mike Spreitzer on June 29, 1989 5:45:20 pm PDT
Something I later realized should be in the main interface.
DIRECTORY BiScrollers;
BiScrollersExtras: CEDAR DEFINITIONS =
BEGIN OPEN BiScrollers;
ShowBox: PROC [bs: BiScroller, client, viewer: Rect, paint, uniformly: BOOLTRUE];
Change scale and offsets so that client data in the client rectangle (in client coords) fill as nearly as possible the viewer rectangle (in viewer coords).
ViewerBox: PROC [bs: BiScroller] RETURNS [Rect--the viewer area, in viewer coordinates--];
ClientBox: PROC [bs: BiScroller] RETURNS [Rect--mbb of client data, in client coordinates--];
Fit: PROC [bs: BiScroller, paint, uniformly: BOOLTRUE];
Change scale and offsets so that all the client data are visible, filling the viewport as nearly as possible. Note that in the presence of a non-multiple-of-90-degrees-rotation, this may not be equivalent to ShowBox[bs, ClientBox[bs], ViewerBox[bs]].
END.