pub struct WithSvg<Builder: PathBuilder> { /* private fields */ }
Expand description
Implements an SVG-like building interface on top of a PathBuilder.
Implementations
sourceimpl<Builder: PathBuilder> WithSvg<Builder>
impl<Builder: PathBuilder> WithSvg<Builder>
pub fn new(builder: Builder) -> Self
pub fn build(self) -> Builder::PathType where
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)
sourceimpl<Builder, Transform> WithSvg<Transformed<Builder, Transform>> where
Builder: PathBuilder,
Transform: Transformation<f32>,
impl<Builder, Transform> WithSvg<Transformed<Builder, Transform>> where
Builder: PathBuilder,
Transform: Transformation<f32>,
pub fn set_transform(&mut self, transform: Transform)
Trait Implementations
sourceimpl<Builder: PathBuilder + Build> Build for WithSvg<Builder>
impl<Builder: PathBuilder + Build> Build for WithSvg<Builder>
sourceimpl<Builder: PathBuilder> SvgPathBuilder for WithSvg<Builder>
impl<Builder: PathBuilder> SvgPathBuilder for WithSvg<Builder>
sourcefn 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
sourcefn 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
sourcefn close(&mut self)
fn close(&mut self)
Ends the current sub-path by connecting it back to its initial point. Read more
sourcefn relative_move_to(&mut self, to: Vector)
fn relative_move_to(&mut self, to: Vector)
Equivalent to move_to
in relative coordinates. Read more
sourcefn relative_line_to(&mut self, to: Vector)
fn relative_line_to(&mut self, to: Vector)
Equivalent to line_to
in relative coordinates. Read more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn horizontal_line_to(&mut self, x: f32)
fn horizontal_line_to(&mut self, x: f32)
Adds an horizontal line segment. Read more
sourcefn 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
sourcefn vertical_line_to(&mut self, y: f32)
fn vertical_line_to(&mut self, y: f32)
Adds a vertical line segment. Read more
sourcefn 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
sourcefn 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
sourcefn 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 more
sourcefn reserve(&mut self, endpoints: usize, ctrl_points: usize)
fn reserve(&mut self, endpoints: usize, ctrl_points: usize)
Hints at the builder that a certain number of endpoints and control points will be added. Read more
sourcefn add_polygon(&mut self, polygon: Polygon<'_, Point>)
fn add_polygon(&mut self, polygon: Polygon<'_, Point>)
Adds a sub-path from a polygon. Read more
Auto Trait Implementations
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
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