stbrp_rect class final

Assign packed locations to rectangles. The rectangles are of type 'stbrp_rect' defined below, stored in the array 'rects', and there are 'num_rects' many of them.

Rectangles which are successfully packed have the 'was_packed' flag set to a non-zero value and 'x' and 'y' store the minimum location on each axis (i.e. bottom-left in cartesian coordinates, top-left if you imagine y increasing downwards). Rectangles which do not fit have the 'was_packed' flag set to 0.

You should not try to access the 'rects' array from another thread while this function is running, as the function temporarily reorders the array while it executes.

To pack into another rectangle, you need to call stbrp_init_target again. To continue packing into the same rectangle, you can call this function again. Calling this multiple times with multiple rect arrays will probably produce worse packing results than calling it a single time with the full rectangle array, but the option is available.

The function returns 1 if all of the rectangles were successfully packed and 0 otherwise.

Inheritance
Implemented types
Available extensions

Constructors

stbrp_rect()

Properties

address Pointer<T>

Available on T, provided by the StructAddress extension

The memory address of the underlying data.
no setter
h int
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id int
reserved for your use:
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
w int
input:
getter/setter pair
was_packed int
non-zero if valid packing
getter/setter pair
x int
output:
getter/setter pair
y int
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited