Skip to content

Conversation

@michaellindahl
Copy link

Removing this rounding aligns the behavior with SwiftUI's HStack. While in most cases this rounding does not have a significant impact, if the Grid 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 with HStack 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 the Grid 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:
WithIntegerRounding

After:
WithoutIntegerRounding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant