pub struct PathBuilder { /* private fields */ }Expand description
可增量构建路径;完成后用 Self::snapshot 或 Self::detach 得到 Path。
Incremental path construction; finish with Self::snapshot or Self::detach into a Path.
Implementations§
Source§impl PathBuilder
impl PathBuilder
Sourcepub fn fill_type(&self) -> PathFillType
pub fn fill_type(&self) -> PathFillType
当前填充规则。Fill rule used when producing a path.
Sourcepub fn set_fill_type(&mut self, ft: PathFillType) -> &mut Self
pub fn set_fill_type(&mut self, ft: PathFillType) -> &mut Self
设置填充规则。Sets fill rule for the built path.
Sourcepub fn toggle_inverse_fill_type(&mut self) -> &mut Self
pub fn toggle_inverse_fill_type(&mut self) -> &mut Self
在普通 / 反色填充之间切换。Toggles inverse fill (same as SkPathBuilder).
Sourcepub fn quad_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32) -> &mut Self
pub fn quad_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32) -> &mut Self
二次贝塞尔。Quadratic bezier.
Sourcepub fn cubic_to(
&mut self,
x1: f32,
y1: f32,
x2: f32,
y2: f32,
x3: f32,
y3: f32,
) -> &mut Self
pub fn cubic_to( &mut self, x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, ) -> &mut Self
三次贝塞尔。Cubic bezier.
Sourcepub fn add_rect(
&mut self,
rect: &Rect,
dir: Direction,
start: RectCorner,
) -> &mut Self
pub fn add_rect( &mut self, rect: &Rect, dir: Direction, start: RectCorner, ) -> &mut Self
添加矩形。Adds a rectangle contour.
Sourcepub fn add_circle(
&mut self,
cx: f32,
cy: f32,
radius: f32,
dir: Direction,
) -> &mut Self
pub fn add_circle( &mut self, cx: f32, cy: f32, radius: f32, dir: Direction, ) -> &mut Self
添加圆。Adds a circle.
Sourcepub fn add_round_rect(
&mut self,
rect: &Rect,
rx: f32,
ry: f32,
dir: Direction,
) -> &mut Self
pub fn add_round_rect( &mut self, rect: &Rect, rx: f32, ry: f32, dir: Direction, ) -> &mut Self
添加圆角矩形(统一 rx/ry)。Adds round rect.
Sourcepub fn add_rrect_with_start(
&mut self,
rrect: &RRect,
dir: Direction,
start: RectCorner,
) -> &mut Self
pub fn add_rrect_with_start( &mut self, rrect: &RRect, dir: Direction, start: RectCorner, ) -> &mut Self
添加 RRect 并指定起始角。Adds RRect with start corner.
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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