C2d.Path
Path2D objects.
The type for Path2D
objects.
val create : unit -> t
create ()
is a new empty path.
val qcurve_to : t -> cx:float -> cy:float -> x:float -> y:float -> unit
qcurve_to p ~cx ~cy x y
is a quadratic curve to (x
,y
) with control point (cx
,cy
).
val ccurve_to :
t ->
cx:float ->
cy:float ->
cx':float ->
cy':float ->
x:float ->
y:float ->
unit
ccurve_to p ~cx ~cy ~cx' ~cy' x y
is a cubic bezier curve to (x
,y
) with control point (cx
,cy
) and (cx'
,cy'
).
val arc_to :
t ->
cx:float ->
cy:float ->
cx':float ->
cy':float ->
r:float ->
unit
arc_to p ~cx ~cy ~cx' ~cy' r
is a circular arc with control points (cx
,cy
), (cx'
,cy'
) and radius r
.
val arc :
?anticlockwise:bool ->
t ->
cx:float ->
cy:float ->
r:float ->
start:float ->
stop:float ->
unit
arc p ~anticlockwise ~cx ~cy ~r ~start ~stop
is a circular arc centered on (cx
,cy
) with radius r
starting at angle start
and stopping at stop
.
val rect : t -> x:float -> y:float -> w:float -> h:float -> unit
react p x y ~w ~h
is a rectangle with top-left corner (x
,y
) extending down by w
units and right by h
units (or the opposite directions with negative values).
val ellipse :
?anticlockwise:bool ->
t ->
cx:float ->
cy:float ->
rx:float ->
ry:float ->
rot:float ->
start:float ->
stop:float ->
unit
ellipse p ~anticlockwise ~cx ~cy ~rot ~rx ~ry ~start ~stop
is an elliptical arc centered on (cx
,cy
) with radii (rx
,ry
) rotated by rot
starting at angle start
and stopping at stop
.