Skip to main content

InlineNode

Struct InlineNode 

Source
pub struct InlineNode {
    pub node_id: NodeId,
    pub origin: Point,
    pub size: Size,
    pub motion_context_animated: bool,
    pub change: LayerChange,
    pub content: Vec<RenderNode>,
    /* private fields */
}
Expand description

A layout node drawn into its parent’s layer instead of a layer of its own, as Compose draws a node without a graphics layer into the display list of the layer above it: a leaf with no layer properties, pointer handling or window origins to publish. The scene matches it with its node as it matches a child layer, and a renderer places its content as it would place a child layer that only moves.

Fields§

§node_id: NodeId

Layout node drawn here.

§origin: Point

The node’s top left in its parent’s layer: its placement and the parent’s content offset, where a layer of its own would lie.

§size: Size

The node’s size: its rect in its own space starts at the origin.

§motion_context_animated: bool

Whether the node lies in a motion context such as an animated scroll, where a renderer must not snap its content rigidly to the pixel grid.

§change: LayerChange

The number the node took when it last changed.

§content: Vec<RenderNode>

The node’s draws and text in draw order, in its own space: primitives and draw runs only.

Implementations§

Source§

impl InlineNode

Source

pub fn node_rect(&self) -> Rect

The node’s rect in its own space.

Source

pub fn transform_to_parent(&self) -> ProjectiveTransform

Maps the node’s space to its parent layer’s: a translation to Self::origin.

Source

pub fn draws_within_bounds(&self) -> bool

Whether everything the node draws lies within its rect, give or take CONTAINED_DRAW_SLACK, as super::LayerNode::draws_within_bounds says of a layer. Worked out at the first call after a change.

Trait Implementations§

Source§

impl Clone for InlineNode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for InlineNode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.