metafizzy / outlayer

:construction_worker: the brains & guts of a layout library
163 stars 63 forks source link

Add `_getItemIndexToLayOut` to allow subclasses to pick the next element... #27

Closed matslindh closed 8 years ago

matslindh commented 9 years ago

... to lay out by themselves.

This allows masonry or similar plugins to implement a custom "element picking" strategy, where they can decide if they want to use an element further into the array of items instead of the default "next" element.

The default behavior is the same as previous versions and should be backwards compatible. As we create a local copy of items that acts as a queue, there might be a slight overhead compared with a single assignment.

desandro commented 8 years ago

Thank you for this contribution. This is a nice feature, but I've never come across a use case for it. I've left this PR open in case others were interested. Looks like it's time to close it up. Thanks again :watermelon: