pub struct StrokeRec { /* private fields */ }Expand description
描边参数,描述如何将路径转为描边轮廓。 Stroke parameters - describes how to expand a path to a stroke outline.
用于 apply_to_path 将路径转换为描边后的填充路径。
Used with apply_to_path to convert a path to its stroked fill equivalent.
Implementations§
Source§impl StrokeRec
impl StrokeRec
Sourcepub fn new_hairline() -> Self
pub fn new_hairline() -> Self
创建极细线样式。Creates hairline style (1-pixel stroke).
Sourcepub fn new_stroke(width: f32, stroke_and_fill: bool) -> Self
pub fn new_stroke(width: f32, stroke_and_fill: bool) -> Self
创建描边样式。Creates stroke style with given width.
Sourcepub fn set_hairline(&mut self)
pub fn set_hairline(&mut self)
设置为极细线。Sets to hairline style.
Sourcepub fn set_stroke_style(&mut self, width: f32, stroke_and_fill: bool)
pub fn set_stroke_style(&mut self, width: f32, stroke_and_fill: bool)
设置描边宽度。Sets stroke width (width=0 may switch to fill/hairline).
Sourcepub fn style(&self) -> StrokeStyle
pub fn style(&self) -> StrokeStyle
当前样式。Returns current style (hairline/fill/stroke).
Sourcepub fn inflation_radius(&self) -> f32
pub fn inflation_radius(&self) -> f32
膨胀半径(用于边界计算)。Inflation radius for bounds.
Sourcepub fn apply_to_path(&self, path: &Path) -> Option<Path>
pub fn apply_to_path(&self, path: &Path) -> Option<Path>
将描边参数应用到路径,返回描边后的填充路径。 Applies stroke to path, returning the stroked outline as a fill path.
若样式为 fill/hairline 则返回 None。 Returns None if style is fill or hairline (no expansion).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StrokeRec
impl RefUnwindSafe for StrokeRec
impl Send for StrokeRec
impl Sync for StrokeRec
impl Unpin for StrokeRec
impl UnsafeUnpin for StrokeRec
impl UnwindSafe for StrokeRec
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