pub struct PathData {
pub id: u64,
/* private fields */
}Fields§
§id: u64Implementations§
Source§impl PathData
impl PathData
pub fn new() -> Self
pub fn verbs(&self) -> &[PathVerb]
pub fn move_to(self, p: Point) -> Self
pub fn line_to(self, p: Point) -> Self
pub fn quad_to(self, ctrl: Point, to: Point) -> Self
pub fn cubic_to(self, ctrl1: Point, ctrl2: Point, to: Point) -> Self
pub fn close(self) -> Self
Sourcepub fn refit(&self, s: f32, dx: f32, dy: f32) -> Self
pub fn refit(&self, s: f32, dx: f32, dy: f32) -> Self
Re-fits every point by p' = p * s + (dx, dy) (uniform scale + translation), returning a new path.
Baking transforms points into path coordinates (not a matrix) so lyon never facets curves; this applies the runtime letterbox fit the same way, keeping the baked path equivalent to the dynamic one.
Sourcepub fn refit_xy(&self, sx: f32, sy: f32, dx: f32, dy: f32) -> Self
pub fn refit_xy(&self, sx: f32, sy: f32, dx: f32, dy: f32) -> Self
Non-uniform variant of refit: p' = (p.x * sx + dx, p.y * sy + dy). object-fit: fill uses sx != sy to stretch the path to the box (distorting the aspect ratio).
Sourcepub fn polygon(points: &[Point]) -> Self
pub fn polygon(points: &[Point]) -> Self
A closed polygon through points (first point is the start; the path is closed back to it).
pub fn bounds(&self) -> Option<Rect>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PathData
impl RefUnwindSafe for PathData
impl Send for PathData
impl Sync for PathData
impl Unpin for PathData
impl UnsafeUnpin for PathData
impl UnwindSafe for PathData
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