pub struct Item<T> {
pub data: T,
pub w: usize,
pub h: usize,
pub rot: Rotation,
}Expand description
An item to be packed by Packer.
Fields§
§data: TData associated with the item (for example, an ID or a reference to an image).
w: usizeThe item’s width.
h: usizeThe item’s height.
rot: RotationThe item may be rotated 90° to fit better.
Allowing rotation slows down the algorithm, because the item
will try to pack using both (w, h) and (h, w) as its size
But this can lead to more efficiently packed results.
If an item is square, it will never be rotated.