pub struct Path { /* private fields */ }
Expand description
A collection of verbs (move_to()
, line_to()
, bezier_to()
, etc.)
describing one or more contours.
Implementations
sourceimpl Path
impl Path
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn set_distance_tolerance(&mut self, value: f32)
pub fn verbs(&self) -> PathIter<'_>
sourcepub fn move_to(&mut self, x: f32, y: f32)
pub fn move_to(&mut self, x: f32, y: f32)
Starts new sub-path with specified point as first point.
sourcepub fn line_to(&mut self, x: f32, y: f32)
pub fn line_to(&mut self, x: f32, y: f32)
Adds line segment from the last point in the path to the specified point.
sourcepub fn bezier_to(
&mut self,
c1x: f32,
c1y: f32,
c2x: f32,
c2y: f32,
x: f32,
y: f32
)
pub fn bezier_to(
&mut self,
c1x: f32,
c1y: f32,
c2x: f32,
c2y: f32,
x: f32,
y: f32
)
Adds cubic bezier segment from last point in the path via two control points to the specified point.
sourcepub fn quad_to(&mut self, cx: f32, cy: f32, x: f32, y: f32)
pub fn quad_to(&mut self, cx: f32, cy: f32, x: f32, y: f32)
Adds quadratic bezier segment from last point in the path via a control point to the specified point.
sourcepub fn arc(&mut self, cx: f32, cy: f32, r: f32, a0: f32, a1: f32, dir: Solidity)
pub fn arc(&mut self, cx: f32, cy: f32, r: f32, a0: f32, a1: f32, dir: Solidity)
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.
sourcepub fn arc_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, radius: f32)
pub fn arc_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, radius: f32)
Adds an arc segment at the corner defined by the last path point, and two specified points.
sourcepub fn rounded_rect(&mut self, x: f32, y: f32, w: f32, h: f32, r: f32)
pub fn rounded_rect(&mut self, x: f32, y: f32, w: f32, h: f32, r: f32)
Creates new rounded rectangle shaped sub-path.
sourcepub 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
)
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
)
Creates new rounded rectangle shaped sub-path with varying radii for each corner.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more