pub struct Border {
pub width: f32,
pub color: Color,
pub radius: f32,
}Expand description
Border 样式(四边等值宽度)
Fields§
§width: f32§color: Color§radius: f32Implementations§
Source§impl Border
impl Border
pub fn new(width: f32, color: Color) -> Self
pub fn with_radius(self, r: f32) -> Self
Sourcepub fn paint_ring(&self, rect: Rect, inner_bg: Color, painter: &mut PaintList)
pub fn paint_ring(&self, rect: Rect, inner_bg: Color, painter: &mut PaintList)
以「外圈实心 + 内圈挖空(用 inner_bg 填充)」方式绘制描边环。
PaintList 无 stroke 原语,故用两个实心 RRect 嵌套模拟描边
(与 Button ghost 模式同原理)。inner_bg 通常传装饰的背景色,
使得内圈与外圈颜色衔接形成环;无背景色时传 TRANSPARENT(退化为实心块)。
Trait Implementations§
impl Copy for Border
impl StructuralPartialEq for Border
Auto Trait Implementations§
impl Freeze for Border
impl RefUnwindSafe for Border
impl Send for Border
impl Sync for Border
impl Unpin for Border
impl UnsafeUnpin for Border
impl UnwindSafe for Border
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