Incular logoIncular
API ReferenceLayout Values

Size

Finite non-negative 2D extent with constructors.

use incular::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let box_size = Size::new(160.0, 96.0);
    let app = Application::new(move |_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(SizedBox::from_size(box_size))
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}
MemberKindNotes
ZEROConstant0.0 × 0.0
new(w, h)ConstructorPanics if non-finite or negative
width / heightFieldsPublic f32

Component-wise Lerp floored at 0. Used by Constraints, SizedBox, and CustomPaint.

Related: Offset, Rect.