Struct rect_packer::DensePacker
[−]
[src]
pub struct DensePacker { /* fields omitted */ }
Similar to Packer
but does not add any padding between rectangles.
Methods
impl DensePacker
[src]
fn new(width: i32, height: i32) -> DensePacker
[src]
Create new empty DensePacker
with the provided parameters.
fn size(&self) -> (i32, i32)
[src]
Get size that this packer was created with.
fn resize(&mut self, width: i32, height: i32)
[src]
Set new size for this packer.
New size should be not less than the current size.
fn pack(
&mut self,
width: i32,
height: i32,
allow_rotation: bool
) -> Option<Rect>
[src]
&mut self,
width: i32,
height: i32,
allow_rotation: bool
) -> Option<Rect>
Pack new rectangle. Returns position of the 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
[src]
Check if rectangle with the specified size can be added.
Trait Implementations
impl Clone for DensePacker
[src]
fn clone(&self) -> DensePacker
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more