pub struct Path {
pub subpaths: Vec<Subpath>,
}Expand description
A path in user space.
Fields§
§subpaths: Vec<Subpath>The subpaths, in the order they were added.
Implementations§
Source§impl Path
impl Path
Sourcepub fn curve_to(&mut self, c1: Point, c2: Point, to: Point)
pub fn curve_to(&mut self, c1: Point, c2: Point, to: Point)
A cubic curve from the current point.
Sourcepub fn add_rect(&mut self, x: f64, y: f64, width: f64, height: f64)
pub fn add_rect(&mut self, x: f64, y: f64, width: f64, height: f64)
Append a rectangle as its own closed subpath.
Sourcepub fn flatten(&self, ctm: Matrix) -> Vec<Vec<Point>>
pub fn flatten(&self, ctm: Matrix) -> Vec<Vec<Point>>
Flatten to device-space polylines, applying ctm.
Curves are subdivided a fixed number of times: enough that the fixtures are visibly round at 1× and cheap to rasterise, and documented as the tolerance model until adaptive flattening replaces it.
Trait Implementations§
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl Forget for Path
impl Freeze for Path
impl Move for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnsafeUnpin for Path
impl UnwindSafe for Path
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more