A path consists of zero or more closed sub-paths, and possibly one open sub-path. Some dc-path% methods extend the open sub-path, some dc-path% methods close the open sub-path, and some dc-path% methods add closed sub-paths. This approach to drawing formulation is inherited from PostScript [Adobe99].
When a path is drawn as a line, a closed sub-path is drawn as a closed figure, analogous to a polygon. An open sub-path is drawn with disjoint start and end points, analogous lines drawn with draw-lines in dc<%>.
When a path is filled or used as a region, the open sub-path (if any) is treated as if it were closed. The content of a path is determined either through the 'even-odd rule or the 'winding rule, as selected at the time when the path is filled or used to generate a region.
A path is not connected to any particular dc<%> object, so setting a dc<%> origin or scale does not affect path operations. Instead, a dc<%>’s origin and scale apply at the time that the path is drawn or used to set a region.
method
(send a-dc-path arc x y width height start-radians end-radians [ counter-clockwise?]) → void? x : real? y : real? width : real? height : real? start-radians : real? end-radians : real? counter-clockwise? : any/c = #t
If the path has no open sub-path, a new one is started with the arc’s starting point. Otherwise, the arc extends the existing sub-path, and the existing path is connected with a line to the arc’s starting point.
method
x : real? y : real? width : (and/c real? (not/c negative?)) height : (and/c real? (not/c negative?))
For curves within the path, the bounding box enclosed the two control points as well as the start and end points. Thus, the bounding box does not always tightly bound the path.
Each list representing a sub-path starts with a vector of two numbers that represent the starting point for the path. Each subsequent element is either a vector of two numbers, which represents a line connecting the previous point to the new one, or a vector of six numbers, which represents a curve connecting the previous point to a new point; in the latter case, the fifth and six numbers in the vector represent the ending point of the curve, the first and second numbers represent the first control point of the curve, and the third and fourth numbers represent the second control point of the curve.
Added in version 1.8 of package draw-lib.
method
(send a-dc-path lines points [ xoffset yoffset]) → void?
points :
(or/c (listof (is-a?/c point%)) (listof (cons/c real? real?))) xoffset : real? = 0 yoffset : real? = 0
method
x : real? y : real? width : (and/c real? (not/c negative?)) height : (and/c real? (not/c negative?))
method
(send a-dc-path rounded-rectangle x y width height [ radius]) → void? x : real? y : real? width : (and/c real? (not/c negative?)) height : (and/c real? (not/c negative?)) radius : real? = -0.25
If radius is positive, the value is used as the radius of the rounded corner. If radius is negative, the absolute value is used as the proportion of the smallest dimension of the rectangle.
If radius is less than -0.5 or more than half of width or height, an exn:fail:contract exception is raised.
method
(send a-dc-path text-outline font str x y [ combine?]) → void? font : (is-a?/c font%) str : string? x : real? y : real? combine? : any/c = #f
See get-initial-matrix for information on the matrix as represented by a vector m.