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

pub struct Rect<T: 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 tl, tr, bl, br

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

Internal data of the rectangle

Methods

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

[src]

Creates a new rectangle

[src]

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

[src]

[src]

[src]

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

[src]

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

Trait Implementations

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

[src]

Formats the value using the given formatter.

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Performs the conversion.