-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Fix offset rounding for odd-sized tiles #74773
Fix offset rounding for odd-sized tiles #74773
Conversation
Have you tested it with non-square tiles? |
Layout/offset axis do not change the outcome. In these cases, the positioning is closer to the intended than with 4.0 stable. Whether or not the exact pixel positioning is correct or not is probably another issue, as it is enforced by |
This shows it doesn't work properly: the tile on the right has incorrect position, it should be 0.5 unit upwards (X axis should go through its middle). This shows it doesn't work properly: for these 3 rows of tiles the middle row should be exactly in between the two other rows rows (both overlaps should be 1.5 unit in height). MRP from #62911 (comment) with this PR: As you can see the the in-editor grid is drawn properly as it's aligned with the (0, 0) cell (the green one) which is properly aligned with the X/Y axes. It's the tiles with odd Y coordinate being rendered incorrectly (like the white one). BTW what I've suggested in #62911 (comment) has the exact same issue. |
That's because the tilemap composes all the tiles in the quadrant using integer coordinates. Perhaps it would be a better change to alter that behaviour. |
Hmm, after having a poke around, it seems it would be a major change to place tiles at non-integer coordinates. The quadrants and related placement data are all coded based on integer coordinates. |
Indeed, seems like that's the exact cause. Doesn't seem like a major change, it's an actual bug, the local positions shouldn't be truncated to ints in there. I'll open a PR. |
Great work, closing. |
Bug: #62911
The issue had two causes.
Bugsquad edit: