Incular logoIncular
API ReferenceLayout Widgets

ClipRRect

Rounded-rectangle raster clip with radius and behavior.

ClipRRect { radius: CornerRadii, clip_behavior: Clip, child: Widget } clips with a rounded-rect boundary. Default behavior AntiAlias.

use incular::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let app = Application::new(|_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(
                ClipRRect::new(
                    16.0,
                    Container::new()
                        .color(Color::WHITE)
                        .width(200.0)
                        .height(120.0),
                ),
            )
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}

Props

Prop

Type

Related: ClipRect, Container.

On this page