package ocaml-canvas
Library
Module
Module type
Parameter
Class
Class type
Path manipulation functions
val create : unit -> t
create ()
creates an empty path object.
val close : t -> unit
close p
closes the path p
.
lineTo p pos
adds a straight line from the path p
's brush position to pos
.
arc p ~center ~radius ~theta1 ~theta2 ~ccw
adds an arc of the given radius
, centered at center
, between angle theta1
to theta2
to the path p
. If ccw
is true, the arc will be drawn counterclockwise. Note that the last point in the subpath (if such point exists) will be connected to the first point of the arc by a straight line.
arcTo p ~p1 ~p2 ~radius
adds an arc of the given radius
using the control points p1
and p2
to the path p
. If the path p
is empty, this behaves as if moveTo p ~p:p1
was called.
quadraticCurveTo path ~cp ~p
adds a quadratic curve from path
's brush position to ~p
with control point ~cp
.
bezierCurveTo path ~cp1 ~cp2 ~p
adds a bezier curve from path
's brush position to ~p
with control points ~cp1
and ~cp2
.
rect p ~pos ~size
adds the rectangle specified by pos
and size
) to the path p
val ellipse :
t ->
center:Point.t ->
radius:Vector.t ->
rotation:float ->
theta1:float ->
theta2:float ->
ccw:bool ->
unit
ellipse p ~center ~radius ~rotation ~theta1 ~theta2
adds an ellipse with the given parameters to the path p
val addTransformed : t -> t -> Transform.t -> unit
addTransformed dst src t
adds the path src
after applying t
to each of its points into the path dst