Question

The masonry plugin stacks a brick into columns. It's a reorder of bricks to minimize the columns. How can it sort the bricks that are wider then the column width?

Was it helpful?

Solution

I think it's using a k-d tree or binary tree or a treemap algorithm. It's also called 2d bin-packing algorithm: http://www.codeincomplete.com/posts/2011/5/7/bin_packing/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top