Incular logoIncular
API ReferenceLayout Widgets

ClipOval

Elliptical raster clip.

ClipOval { clip_behavior: Clip, child: Widget } clips with an elliptical boundary inscribed in the box. 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(
                ClipOval::new(
                    Container::new()
                        .color(Color::WHITE)
                        .width(160.0)
                        .height(160.0),
                ),
            )
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}

Props

Prop

Type

Related: ClipRect, Avatar.

On this page