Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rounding bound to integers #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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