[plt-scheme] 299.26 - now more 'aligned

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jan 6 17:37:13 EST 2005

New exp-tagged code for MrEd makes 'aligned smoothing work better.
Although 'smoothed mode is mathematically simpler, probably 'aligned
mode is better than 'smoothed for most purposes.

Like 'smoothed mode, 'aligned draws curves and lines with smoothing,
but it first aligns shapes on pixel boundaries to avoid blurring. In
particular, vertical and horizontal lines always match pixel boundaries
in 'aligned mode.

The 'aligned mode is also more consistent with 'unsmoothed mode. For
example, the outline of two ellipses of width N will touch --- but not
overlap --- when they are separated horizontally by N. In contrast, the
two ellipses overlap by half a pen width in 'smoothed mode, since the
pen is cenetered on the ellipse edge. Consistency with 'unsmoothed is
useful if you cannot depend on the availability of smoothing (e.g.,
because the end user under X didn't install Cairo).

The 'aligned mode is implemented by applying `floor' to drawing
locations after scaling and translation. For pen drawing, the locations
are further shifted down and right by half a pen width, and widths and
heights (for rectangles, ellipses, etc.) are reduced by half a pen
width.

[I think that 'aligned is essentially the same thing as Java 1.3's
 VALUE_STROKE_NORMALIZE.]

Matthew



Posted on the users mailing list.