Skip to main content

Placeable

Trait Placeable 

Source
pub trait Placeable {
    // Required methods
    fn place(&self, x: f32, y: f32);
    fn width(&self) -> f32;
    fn height(&self) -> f32;
    fn node_id(&self) -> NodeId;

    // Provided method
    fn content_offset(&self) -> (f32, f32) { ... }
}
Expand description

Result of running a measurement pass for a single child.

Required Methods§

Source

fn place(&self, x: f32, y: f32)

Places the child at the provided coordinates relative to its parent.

Source

fn width(&self) -> f32

Returns the measured width of the child.

Source

fn height(&self) -> f32

Returns the measured height of the child.

Source

fn node_id(&self) -> NodeId

Returns the identifier for the underlying layout node.

Provided Methods§

Source

fn content_offset(&self) -> (f32, f32)

Returns the accumulated content offset from the coordinator chain. This is used by layout modifiers (like scroll) to report where content should be positioned within this placeable’s bounds. Default is (0.0, 0.0) for no offset.

Implementors§