Page 29 Table of Contents Index Page 31
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E





Chapter 4

Bounding Rectangles

4.1 Bounding Rectangles

Every bounded region has a derived bounding rectangle, which is a rectangular region whose
sides are parallel to the coordinate axes. Therefore, every bounded region participates in the
bounding rectangle protocol. The bounding rectangle for a region is the smallest rectangle that
contains every point in the region. However, the bounding rectangle may contain additional
points as well. Unbounded regions do not have a bounding rectangle and do not participate
in the bounding rectangle protocol. Other objects besides bounded regions participate in the
bounding rectangle protocol, such as sheets and output records.

The coordinate system in which the bounding rectangle is maintained depends on the context.
For example, the coordinates of the bounding rectangle of a sheet are expressed in the sheet's
parent's coordinate system. For output records, the coordinates of the bounding rectangle are
maintained in the coordinate system of the stream with which the output record is associated.

Note that the bounding rectangle of a transformed region is not in general the same as the result
of transforming the bounding rectangle of a region, as shown in Figure 4.1. For transforma-
tions that satisfy rectilinear-transformation-p, the following equality holds. For all other
transformations, it does not hold.
 
 (region-equal
   (transform-region transformation (bounding-rectangle region))
   (bounding-rectangle (transform-region transformation region)))

CLIM uses bounding rectangles for a variety of purposes. For example, repainting of windows
is driven from the bounding rectangle of the window's viewport, intersected with a "damage"
region. The formatting engines used by formatting-table and formatting-graph operate on
the bounding rectangles of the output records in the output. Bounding rectangles are also used
internally by CLIM to achieve greater efficiency. For instance, when performing hit detection to


Page 29 Table of Contents Index Page 31
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E