- From: Ethan Jimenez via GitHub <sysbot+gh@w3.org>
- Date: Thu, 12 Dec 2024 00:44:53 +0000
- To: public-css-archive@w3.org
The latest algorithm sounds reasonable, as Tab commented, the only cost of this algorithm is keeping track of the gaps. This is fairly doable if we store the current and all previous running positions for each track in the grid axis. However, when you consider items spanning multiple tracks there are a couple of issues that need clarifying: 1. Is it the expectation that, when looking for a previous gap for an item spanning multiple tracks, we use the maximum running position across spanned tracks? The figure below exemplifies how the item might be placed into multiple possible gaps. ![masonry-dense-packing-example](https://github.com/user-attachments/assets/7e31e04e-49e7-44aa-abec-b93600437760) 2. Combining gaps from multiple tracks is not an easy process, the algorithm would need to consider the complexity of matching a gap from one track with (possibly more than) one gap in the next tracks, implying non-trivial decision making. Consider trying to place an item spanning 2 tracks in the example below (where all tracks have the same used size), choosing the upper gap in the third track produces the gap highlighted in pink: ![masonry-dense-packing-gap-00](https://github.com/user-attachments/assets/43c3d0cd-5857-4699-b4db-dd128ba331fa) While choosing the lower gap produces the following smaller gap: ![masonry-dense-packing-gap-01](https://github.com/user-attachments/assets/f6a04b9f-5ec8-498e-a2a9-245768fe9db9) -- GitHub Notification of comment by ethanjv Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9326#issuecomment-2537499545 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 12 December 2024 00:44:53 UTC