Incular logoIncular
API ReferenceLayout Values

Offset

2D point and vector in logical pixels.

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(
                Transform::translation(
                    Offset::new(16.0, 8.0),
                    Text::new("Shifted"),
                ),
            )
            .build()
            .into()
    })?;
    incular::run(app)?;
    Ok(())
}
MemberKindNotes
ZEROConstant(0.0, 0.0)
new(x, y)Constructorconst fn, any finite values
x / yFieldsPublic f32

Supports Lerp. Used for positions, drag deltas (GestureDetector), and Transform pivots.

Related: Size, Rect.