[][src]Struct femtovg::Path

pub struct Path { /* fields omitted */ }

A collection of verbs (move_to(), line_to(), bezier_to(), etc.) describing one or more contours.

Implementations

impl Path[src]

pub fn new() -> Self[src]

pub fn size(&self) -> usize[src]

Memory usage in bytes

pub fn is_empty(&self) -> bool[src]

pub fn set_distance_tolerance(&mut self, value: f32)[src]

pub fn verbs(&self) -> PathIter<'_>[src]

pub fn move_to(&mut self, x: f32, y: f32)[src]

Starts new sub-path with specified point as first point.

pub fn line_to(&mut self, x: f32, y: f32)[src]

Adds line segment from the last point in the path to the specified point.

pub fn bezier_to(
    &mut self,
    c1x: f32,
    c1y: f32,
    c2x: f32,
    c2y: f32,
    x: f32,
    y: f32
)
[src]

Adds cubic bezier segment from last point in the path via two control points to the specified point.

pub fn quad_to(&mut self, cx: f32, cy: f32, x: f32, y: f32)[src]

Adds quadratic bezier segment from last point in the path via a control point to the specified point.

pub fn close(&mut self)[src]

Closes current sub-path with a line segment.

pub fn solidity(&mut self, solidity: Solidity)[src]

Sets the current sub-path winding, see Solidity

pub fn arc(&mut self, cx: f32, cy: f32, r: f32, a0: f32, a1: f32, dir: Solidity)[src]

Creates new circle arc shaped sub-path. The arc center is at cx,cy, the arc radius is r, and the arc is drawn from angle a0 to a1, and swept in direction dir (Winding) Angles are specified in radians.

pub fn arc_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, radius: f32)[src]

Adds an arc segment at the corner defined by the last path point, and two specified points.

pub fn rect(&mut self, x: f32, y: f32, w: f32, h: f32)[src]

Creates new rectangle shaped sub-path.

pub fn rounded_rect(&mut self, x: f32, y: f32, w: f32, h: f32, r: f32)[src]

Creates new rounded rectangle shaped sub-path.

pub fn rounded_rect_varying(
    &mut self,
    x: f32,
    y: f32,
    w: f32,
    h: f32,
    rad_top_left: f32,
    rad_top_right: f32,
    rad_bottom_right: f32,
    rad_bottom_left: f32
)
[src]

Creates new rounded rectangle shaped sub-path with varying radii for each corner.

pub fn ellipse(&mut self, cx: f32, cy: f32, rx: f32, ry: f32)[src]

Creates new ellipse shaped sub-path.

pub fn circle(&mut self, cx: f32, cy: f32, r: f32)[src]

Creates new circle shaped sub-path.

Trait Implementations

impl Clone for Path[src]

impl Debug for Path[src]

impl Default for Path[src]

impl OutlineBuilder for Path[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.