pub enum ClipShape {
Rect(Rect),
RoundedRect {
rect: Rect,
radii: [f32; 4],
},
}Expand description
Clip-region shape for Node::Clip. Rectangular clips map onto scissor on backends that support it
(Qt QSGClipNode { isRectangular = true }, GSK GskClipNode); rounded clips require stencil / mask
(Qt QSGClipNode + geometry, GSK GskRoundedClipNode).
Variants§
Rect(Rect)
Axis-aligned rectangle.
RoundedRect
Rounded rectangle with per-corner radii in [top_left, top_right, bottom_right, bottom_left] order
(CSS shorthand). A single uniform radius is represented by all four entries equal.
Implementations§
Source§impl ClipShape
impl ClipShape
Sourcepub fn from_rect_radius(rect: Rect, radius: f32) -> Self
pub fn from_rect_radius(rect: Rect, radius: f32) -> Self
Builds a ClipShape::RoundedRect when radius > 0.0, otherwise ClipShape::Rect.
Trait Implementations§
Source§impl From<&ExtractedClipBox> for ClipShape
impl From<&ExtractedClipBox> for ClipShape
Source§fn from(c: &ExtractedClipBox) -> Self
fn from(c: &ExtractedClipBox) -> Self
Converts to this type from the input type.
impl Copy for ClipShape
impl StructuralPartialEq for ClipShape
Auto Trait Implementations§
impl Freeze for ClipShape
impl RefUnwindSafe for ClipShape
impl Send for ClipShape
impl Sync for ClipShape
impl Unpin for ClipShape
impl UnsafeUnpin for ClipShape
impl UnwindSafe for ClipShape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.