Struct nanovg::Path [−][src]
pub struct Path<'a, 'b> where
'b: 'a, { /* fields omitted */ }
A path, the main type for most NanoVG drawing operations.
Methods
impl<'a, 'b> Path<'a, 'b>
[src]
impl<'a, 'b> Path<'a, 'b>
pub fn context(&self) -> &'a Context
[src]
pub fn context(&self) -> &'a Context
Get the underlying context this path was created on.
pub fn fill<T: Paint>(&self, paint: T, options: FillOptions)
[src]
pub fn fill<T: Paint>(&self, paint: T, options: FillOptions)
Draw the current path by filling in it's shape. 'paint' specifies in which color/paint should fill be drawn. pass variables that implement Paint trait for now these are: Color, Gradient, ImagePattern 'options' specifies how filling should be done.
pub fn stroke<T: Paint>(&self, paint: T, options: StrokeOptions)
[src]
pub fn stroke<T: Paint>(&self, paint: T, options: StrokeOptions)
Draw the current path by stroking it's perimeter. 'paint' specifies in which color/paint should stroke be drawn. pass variables that implement Paint trait for now these are: Color, Gradient, ImagePattern 'options' specifies how stroking should be done.
pub fn arc(
&self,
(cx, cy): (f32, f32),
radius: f32,
start_angle: f32,
end_angle: f32,
winding: Winding
)
[src]
pub fn arc(
&self,
(cx, cy): (f32, f32),
radius: f32,
start_angle: f32,
end_angle: f32,
winding: Winding
)
Add an arc to the path.
pub fn rect(&self, (x, y): (f32, f32), (w, h): (f32, f32))
[src]
pub fn rect(&self, (x, y): (f32, f32), (w, h): (f32, f32))
Add a rectangle to the path.
pub fn rounded_rect(&self, (x, y): (f32, f32), (w, h): (f32, f32), radius: f32)
[src]
pub fn rounded_rect(&self, (x, y): (f32, f32), (w, h): (f32, f32), radius: f32)
Add a rounded rectangle to the path.
pub fn rounded_rect_varying(
&self,
(x, y): (f32, f32),
(w, h): (f32, f32),
top_radii: (f32, f32),
bottom_radii: (f32, f32)
)
[src]
pub fn rounded_rect_varying(
&self,
(x, y): (f32, f32),
(w, h): (f32, f32),
top_radii: (f32, f32),
bottom_radii: (f32, f32)
)
Add a rounded rectangle with varying corners to the path.
top_radii
and bottom_radii
are both tuples in the form (left, right).
pub fn ellipse(&self, (cx, cy): (f32, f32), radius_x: f32, radius_y: f32)
[src]
pub fn ellipse(&self, (cx, cy): (f32, f32), radius_x: f32, radius_y: f32)
Add an ellipse to the path.
pub fn circle(&self, (cx, cy): (f32, f32), radius: f32)
[src]
pub fn circle(&self, (cx, cy): (f32, f32), radius: f32)
Add a circle to the path.
pub fn line_to(&self, (x, y): (f32, f32))
[src]
pub fn line_to(&self, (x, y): (f32, f32))
Add a line to the subpath.
pub fn cubic_bezier_to(
&self,
(x, y): (f32, f32),
control1: (f32, f32),
control2: (f32, f32)
)
[src]
pub fn cubic_bezier_to(
&self,
(x, y): (f32, f32),
control1: (f32, f32),
control2: (f32, f32)
)
Add a cubic bezier curve to the subpath.
pub fn quad_bezier_to(&self, (x, y): (f32, f32), control: (f32, f32))
[src]
pub fn quad_bezier_to(&self, (x, y): (f32, f32), control: (f32, f32))
Add a quadratic bezier curve to the subpath.
pub fn arc_to(&self, p1: (f32, f32), p2: (f32, f32), radius: f32)
[src]
pub fn arc_to(&self, p1: (f32, f32), p2: (f32, f32), radius: f32)
Add a arc to the subpath.
pub fn winding(&self, winding: Winding)
[src]
pub fn winding(&self, winding: Winding)
Set the winding of the subpath. The winding defines which parts of the subpath are 'inside' and which are 'outside'.
pub fn move_to(&self, (x, y): (f32, f32))
[src]
pub fn move_to(&self, (x, y): (f32, f32))
Start new sub-path with specified coordinates as the first point.
pub fn close(&self)
[src]
pub fn close(&self)
Close the path, ie. connect the first point and last point with a line.