Struct rect_packer::TightPacker
[−]
[src]
pub struct TightPacker { /* fields omitted */ }
Similar to Packer
but does not add any padding between rectangles.
Methods
impl TightPacker
[src]
fn new(width: i32, height: i32) -> TightPacker
Create new empty TightPacker
with the provided parameters.
fn pack(&mut self,
width: i32,
height: i32,
allow_rotation: bool)
-> Option<Rect>
width: i32,
height: i32,
allow_rotation: bool)
-> Option<Rect>
Pack new rectangle. Returns position of newly added rectangle. If there is not enough space returns None
.
If it returns None
you can still try to add smaller rectangles.
allow_rotation
- allow 90° rotation of the input rectangle. You can detect whether rectangle was rotated by comparing
returned width
and height
with the supplied ones.
fn can_pack(&self, width: i32, height: i32, allow_rotation: bool) -> bool
Check if rectangle with the specified size can be added.
Trait Implementations
impl Clone for TightPacker
[src]
fn clone(&self) -> TightPacker
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more