Open yairEO opened 10 years ago
Maybe I add the option to set the height of the last row to the average height of all other rows. Would this be okay?
I think it's much much more simple for this kind of things. it can be done with a tiny amount of code. you only need to calculate the size of one item to know if they all will fit well, not even the margin between them, it can stay fixed, just their sizes must be changed upon resize, but it's really easy to calculate, and then just apply the same calculations to all the items.
(row_width - margin * (number_of_row_items - 1)) / number_of_row_items = item_width
If an item becomes too small, change the formula and make number_of_row_items
smaller
I wrote a test page for my idea:
If you have items which are all exactly the same initial width and height, and start resizing their container, then the last row doesn't match, and it looks weird. This is a no-go for my client:
A grid item should always have the same dimensions as the rest, if they are all the same size. maybe it can be added as an option to the plugin.