Page 98 Table of Contents Index Page 100
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 12. GRAPHICS




Figure 12.4: An aesthetically pleasing circle.

should attempt to draw.

A consequence of these rendering conventions is that, when the start or end coordinate (minus
1/2 the line thickness, if the shape is a path) is not an integer, then rendering is not symmetric
under reflection transformations. Thus to correctly and portably draw an outline of thickness
1 around a (rectilinear) rectangular area with integral coordinates, the outline path must have
half-integral coordinates. Drawing rectilinear areas whose boundaries are not on pixel boundaries
cannot be guaranteed to be portable. Another way to say the same thing is that the "control
points" for a rectangular area are at the corners, while the control points for a rectilinear path
are in the center of the path, not at the corners. Therefore, in order for a path and an area to
abut seamlessly, the coordinates of the path must be offset from the coordinates of the area by
half the path's thickness.

12.4.1 Permissible Alternatives During Rendering

Some platforms may distinguish between lines of the minimum thinness from lines that are
thicker than that. The two rasterizations depicted in Figure 12.5 are both perfectly reasonable
rasterizations of tilted lines that are a single device unit wide. The right-hand line is drawn as
a tilted rectangle, the left as the "thinnest visible" line.

For thick lines, a platform may choose to draw the exact tilted fractional rectangle, or the
coordinates of that rectangle might be rounded so that it is distorted into another polygonal
shape. The latter case may be prove to be faster on some platforms. The two rasterizations
depicted in Figure 12.6 are both reasonable.

The decision about which side of the shape to take when a boundary line passes through the
decision point is made arbitrarily, although we have chosen to be compatible with the X11
definition. This is not necessarily the most convenient decision. The main problem with this
is illustrated by the case of a horizontal line (see Figure 12.7). Our definition chooses to draw


Page 98 Table of Contents Index Page 100
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