Struct layout2d::rect::Rect [] [src]

pub struct Rect<T: Copy + Clone> {
    pub x: [f32; 4],
    pub y: [f32; 4],
    pub z: f32,
    pub data: NodeData<T>,
}

A finite rectangle in pixel coordinates that will end up on the screen

Fields

x coordinates - as an array because of simd layout tl, tr, bl, br

y coordinates - as an array because of simd layout top left, top right, bottom left, bottom right

Z-index is an int in order to achieve z-order sortability

Internal data of the rectangle

Methods

impl<T: Copy + Clone> Rect<T>
[src]

Creates a new rectangle

Creates a new rectangle with width / height instead of top / bottom

Set width from top left corner Warning: may not work well after rotations

Set height from top left corner Warning: may not work well after rotations

Trait Implementations

impl<T: Debug + Copy + Clone> Debug for Rect<T>
[src]

Formats the value using the given formatter.

impl<T: Copy + Clone> From<NodeData<T>> for Rect<T>
[src]

Performs the conversion.