pub struct PathBuilder {
pub style: PathStyle,
/* private fields */
}Expand description
重导出路径构建器
Path 构建器。
Fields§
§style: PathStylePathBuilder 的 PathStyle。
Implementations§
Source§impl PathBuilder
impl PathBuilder
Sourcepub fn stroke(width: Pixels) -> Self
pub fn stroke(width: Pixels) -> Self
创建新的 PathBuilder 以构建描边路径。
Sourcepub fn fill() -> Self
pub fn fill() -> Self
创建新的 PathBuilder 以构建填充路径。
Sourcepub fn with_style(self, style: PathStyle) -> Self
pub fn with_style(self, style: PathStyle) -> Self
设置 PathBuilder 的样式。
Sourcepub fn dash_array(self, dash_array: &[Pixels]) -> Self
pub fn dash_array(self, dash_array: &[Pixels]) -> Self
设置 PathBuilder 的虚线数组。填充样式忽略虚线。
Sourcepub fn cubic_bezier_to(
&mut self,
to: Point<Pixels>,
control_a: Point<Pixels>,
control_b: Point<Pixels>,
)
pub fn cubic_bezier_to( &mut self, to: Point<Pixels>, control_a: Point<Pixels>, control_b: Point<Pixels>, )
向 Path 添加三次贝塞尔曲线,给定其两个控制点和终点。
Sourcepub fn arc_to(
&mut self,
radii: Point<Pixels>,
x_rotation: Pixels,
large_arc: bool,
sweep: bool,
to: Point<Pixels>,
)
pub fn arc_to( &mut self, radii: Point<Pixels>, x_rotation: Pixels, large_arc: bool, sweep: bool, to: Point<Pixels>, )
添加椭圆弧。
Sourcepub fn relative_arc_to(
&mut self,
radii: Point<Pixels>,
x_rotation: Pixels,
large_arc: bool,
sweep: bool,
to: Point<Pixels>,
)
pub fn relative_arc_to( &mut self, radii: Point<Pixels>, x_rotation: Pixels, large_arc: bool, sweep: bool, to: Point<Pixels>, )
等效于相对坐标中的 arc_to。
Sourcepub fn add_polygon(&mut self, points: &[Point<Pixels>], closed: bool)
pub fn add_polygon(&mut self, points: &[Point<Pixels>], closed: bool)
添加多边形。
Trait Implementations§
Source§impl Default for PathBuilder
impl Default for PathBuilder
Source§impl From<NoAttributes<BuilderImpl>> for PathBuilder
impl From<NoAttributes<BuilderImpl>> for PathBuilder
Source§impl From<WithSvg<BuilderImpl>> for PathBuilder
impl From<WithSvg<BuilderImpl>> for PathBuilder
Source§fn from(raw: WithSvg<BuilderImpl>) -> Self
fn from(raw: WithSvg<BuilderImpl>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for PathBuilder
impl Freeze for PathBuilder
impl Move for PathBuilder
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnsafeUnpin for PathBuilder
impl UnwindSafe for PathBuilder
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more