pub struct RRect { /* private fields */ }Expand description
圆角矩形,支持四角独立半径。 Rounded rectangle with per-corner radii (each corner can have different x/y).
Implementations§
Source§impl RRect
impl RRect
Sourcepub fn from_rect_xy(rect: &Rect, rx: f32, ry: f32) -> Self
pub fn from_rect_xy(rect: &Rect, rx: f32, ry: f32) -> Self
从矩形与统一圆角创建。Creates rounded rect with uniform radii.
Sourcepub fn from_rect_radii(rect: &Rect, radii: &[Radii; 4]) -> Self
pub fn from_rect_radii(rect: &Rect, radii: &[Radii; 4]) -> Self
从矩形与四角半径创建。Creates RRect with per-corner radii.
radii 顺序:UpperLeft, UpperRight, LowerRight, LowerLeft。
Radii order: UpperLeft, UpperRight, LowerRight, LowerLeft.
Sourcepub fn radii(&self, corner: RectCorner) -> Radii
pub fn radii(&self, corner: RectCorner) -> Radii
获取某角半径。Returns radii for corner (UpperLeft, UpperRight, LowerRight, LowerLeft).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RRect
impl RefUnwindSafe for RRect
impl Send for RRect
impl Sync for RRect
impl Unpin for RRect
impl UnsafeUnpin for RRect
impl UnwindSafe for RRect
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