Updating gallery layout to use Robs distribution logic from v2#2289
Conversation
|
Build successful! 🎉 |
…nto gallery_layout_update_min_width
|
Build successful! 🎉 |
…the virtualizer is less than the minItem width
|
Build successful! 🎉 |
need to figure out why the partition doesnt quite work
| } | ||
|
|
||
| let weightedRatios = ratios.map(ratio => ratio < this.threshold ? ratio + (0.5 * (1 / ratio)) : ratio); | ||
| let partition = linearPartition(weightedRatios, rows); |
There was a problem hiding this comment.
This partitioning doesn't quite respect the minItemSize.height provided, will need to dig into how the linearPartition works. May require a refactor of these calculations but that can be done after this alpha
|
Build successful! 🎉 |
…nto gallery_layout_update_min_width
…nto gallery_layout_update_min_width
|
Build successful! 🎉 |
|
I wonder, should min-width only apply when there is body content (title/actions/description/footer) so that if it's just the image, they look nice and flush? check out google photos gallery view. sometimes the checkbox extends outside the image |
|
@snowystinger hm, a bit tricky to do with the currently implementation since the layout doesn't know anything about the card contents but perhaps something to explore with a refactor to the layout as a whole. I also wonder about how it would look if the user mixes cards with content and cards that only have the image |
…nto gallery_layout_update_min_width
|
Build successful! 🎉 |
| // Compute aspect ratios for all of the items, and the total width if all items were on in a single row. | ||
| let ratios = []; | ||
| let totalWidth = 0; | ||
| let minRatio = this.minItemSize.width / this.minItemSize.height; |
There was a problem hiding this comment.
well that doesn't seem good, lets sit down and go through the math together sometime

Closes
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: