Packing algorithm


I’m working on a simple app where I need to position rectangular shapes. The
width into which I want to position a number of rectangles is set; the height can
be changed as long as all rectangles fit into the width.

I also need to change the width real-time which should reposition all rectangles. The
“y” position of the rectangles shouldn’t change to much; so when a small rectangle is
positioned at 0,0 and another one at 200,200 I would like the y position to be around a
certain margin (i.e. 50 pixels).

i know about packing algoritms but I was wondering if someone knows a good/simple
implementation which does what I want :slight_smile:

Thanks fine OF-people!