#[repr(C, u8)]pub enum CssShape {
Circle(ShapeCircle),
Ellipse(ShapeEllipse),
Polygon(ShapePolygon),
Inset(ShapeInset),
Path(ShapePath),
}Expand description
Represents a CSS shape for shape-inside, shape-outside, and clip-path. Used for both text layout (shape-inside/outside) and rendering clipping (clip-path).
Variants§
Implementations§
Source§impl CssShape
impl CssShape
Sourcepub fn circle(center: ShapePoint, radius: f32) -> Self
pub fn circle(center: ShapePoint, radius: f32) -> Self
Creates a circle shape at the given position with the given radius
Sourcepub fn ellipse(center: ShapePoint, radius_x: f32, radius_y: f32) -> Self
pub fn ellipse(center: ShapePoint, radius_x: f32, radius_y: f32) -> Self
Creates an ellipse shape
Sourcepub fn polygon(points: ShapePointVec) -> Self
pub fn polygon(points: ShapePointVec) -> Self
Creates a polygon from a list of points
Sourcepub fn inset_rounded(
top: f32,
right: f32,
bottom: f32,
left: f32,
radius: f32,
) -> Self
pub fn inset_rounded( top: f32, right: f32, bottom: f32, left: f32, radius: f32, ) -> Self
Creates an inset rectangle with rounded corners
pub fn print_as_css_value(&self) -> String
pub fn format_as_rust_code(&self) -> String
Trait Implementations§
Source§impl Ord for CssShape
impl Ord for CssShape
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for CssShape
impl PartialOrd for CssShape
impl Eq for CssShape
impl StructuralPartialEq for CssShape
Auto Trait Implementations§
impl Freeze for CssShape
impl RefUnwindSafe for CssShape
impl Send for CssShape
impl Sync for CssShape
impl Unpin for CssShape
impl UnsafeUnpin for CssShape
impl UnwindSafe for CssShape
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