pub struct WithSvg<Builder: PathBuilder> { /* private fields */ }
Expand description
Implements an SVG-like building interface on top of a PathBuilder.
Implementations§
source§impl<Builder: PathBuilder> WithSvg<Builder>
impl<Builder: PathBuilder> WithSvg<Builder>
pub fn new(builder: Builder) -> Self
pub fn build(self) -> Builder::PathTypewhere
Builder: Build,
pub fn flattened(self, tolerance: f32) -> WithSvg<Flattened<Builder>>
pub fn transformed<Transform>(
self,
transform: Transform,
) -> WithSvg<Transformed<Builder, Transform>>where
Transform: Transformation<f32>,
pub fn move_to(&mut self, to: Point) -> EndpointId
pub fn line_to(&mut self, to: Point) -> EndpointId
pub fn close(&mut self)
pub fn quadratic_bezier_to(&mut self, ctrl: Point, to: Point) -> EndpointId
pub fn cubic_bezier_to( &mut self, ctrl1: Point, ctrl2: Point, to: Point, ) -> EndpointId
pub fn arc( &mut self, center: Point, radii: Vector, sweep_angle: Angle, x_rotation: Angle, )
pub fn current_position(&self) -> Point
pub fn reserve(&mut self, endpoints: usize, ctrl_points: usize)
source§impl<Builder, Transform> WithSvg<Transformed<Builder, Transform>>
impl<Builder, Transform> WithSvg<Transformed<Builder, Transform>>
pub fn set_transform(&mut self, transform: Transform)
Trait Implementations§
source§impl<Builder: PathBuilder> SvgPathBuilder for WithSvg<Builder>
impl<Builder: PathBuilder> SvgPathBuilder for WithSvg<Builder>
source§fn close(&mut self)
fn close(&mut self)
Ends the current sub-path by connecting it back to its initial point. Read more
source§fn quadratic_bezier_to(&mut self, ctrl: Point, to: Point)
fn quadratic_bezier_to(&mut self, ctrl: Point, to: Point)
Adds a quadratic bézier segment to the current sub-path. Read more
source§fn cubic_bezier_to(&mut self, ctrl1: Point, ctrl2: Point, to: Point)
fn cubic_bezier_to(&mut self, ctrl1: Point, ctrl2: Point, to: Point)
Adds a cubic bézier segment to the current sub-path. Read more
source§fn relative_move_to(&mut self, to: Vector)
fn relative_move_to(&mut self, to: Vector)
Equivalent to
move_to
in relative coordinates. Read moresource§fn relative_line_to(&mut self, to: Vector)
fn relative_line_to(&mut self, to: Vector)
Equivalent to
line_to
in relative coordinates. Read moresource§fn relative_quadratic_bezier_to(&mut self, ctrl: Vector, to: Vector)
fn relative_quadratic_bezier_to(&mut self, ctrl: Vector, to: Vector)
Equivalent to
quadratic_bezier_to
in relative coordinates. Read moresource§fn relative_cubic_bezier_to(&mut self, ctrl1: Vector, ctrl2: Vector, to: Vector)
fn relative_cubic_bezier_to(&mut self, ctrl1: Vector, ctrl2: Vector, to: Vector)
Equivalent to
cubic_bezier_to
in relative coordinates. Read moresource§fn smooth_cubic_bezier_to(&mut self, ctrl2: Point, to: Point)
fn smooth_cubic_bezier_to(&mut self, ctrl2: Point, to: Point)
Equivalent to
cubic_bezier_to
with implicit first control point. Read moresource§fn smooth_relative_cubic_bezier_to(&mut self, ctrl2: Vector, to: Vector)
fn smooth_relative_cubic_bezier_to(&mut self, ctrl2: Vector, to: Vector)
Equivalent to
smooth_cubic_bezier_to
in relative coordinates. Read moresource§fn smooth_quadratic_bezier_to(&mut self, to: Point)
fn smooth_quadratic_bezier_to(&mut self, to: Point)
Equivalent to
quadratic_bezier_to
with implicit control point. Read moresource§fn smooth_relative_quadratic_bezier_to(&mut self, to: Vector)
fn smooth_relative_quadratic_bezier_to(&mut self, to: Vector)
Equivalent to
smooth_quadratic_bezier_to
in relative coordinates. Read moresource§fn horizontal_line_to(&mut self, x: f32)
fn horizontal_line_to(&mut self, x: f32)
Adds an horizontal line segment. Read more
source§fn relative_horizontal_line_to(&mut self, dx: f32)
fn relative_horizontal_line_to(&mut self, dx: f32)
Adds an horizontal line segment in relative coordinates. Read more
source§fn vertical_line_to(&mut self, y: f32)
fn vertical_line_to(&mut self, y: f32)
Adds a vertical line segment. Read more
source§fn relative_vertical_line_to(&mut self, dy: f32)
fn relative_vertical_line_to(&mut self, dy: f32)
Adds a vertical line segment in relative coordinates. Read more
source§fn arc_to(
&mut self,
radii: Vector,
x_rotation: Angle,
flags: ArcFlags,
to: Point,
)
fn arc_to( &mut self, radii: Vector, x_rotation: Angle, flags: ArcFlags, to: Point, )
Adds an elliptical arc. Read more
source§fn relative_arc_to(
&mut self,
radii: Vector,
x_rotation: Angle,
flags: ArcFlags,
to: Vector,
)
fn relative_arc_to( &mut self, radii: Vector, x_rotation: Angle, flags: ArcFlags, to: Vector, )
Equivalent to
arc_to
in relative coordinates. Read moreAuto Trait Implementations§
impl<Builder> Freeze for WithSvg<Builder>where
Builder: Freeze,
impl<Builder> RefUnwindSafe for WithSvg<Builder>where
Builder: RefUnwindSafe,
impl<Builder> Send for WithSvg<Builder>where
Builder: Send,
impl<Builder> Sync for WithSvg<Builder>where
Builder: Sync,
impl<Builder> Unpin for WithSvg<Builder>where
Builder: Unpin,
impl<Builder> UnwindSafe for WithSvg<Builder>where
Builder: UnwindSafe,
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