Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removing this rounding aligns the behavior with SwiftUI's
HStack
. While in most cases this rounding does not have a significant impact, if theGrid
has zero spacing there will become minor differences between the edges of each cell due to the differences between pixels and points. It's possible that rather than integer rounding we should be performing pixel rounding, but due to the alignment withHStack
after this change, I'm proposing the easier option.I created an example view controller that highlights the issue here: https://github.com/michaellindahl/Grid/tree/pixels-vs-points
Note that I created a checkerboard pattern of border that is present with the
HStack
, but with theGrid
the border is not always visible (e.g. see the trailing border on the first cell which is hidden by the second cell overlapping it).This becomes a bigger issue when looking at the last grid where the tall cell on the far right is on top and below it's neighbors on the left.
Before:
After: