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

Bug: Hex TilePos can have its fields equal to map size #466

Open
Piturnah opened this issue Sep 10, 2023 · 0 comments
Open

Bug: Hex TilePos can have its fields equal to map size #466

Piturnah opened this issue Sep 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Piturnah
Copy link
Contributor

Piturnah commented Sep 10, 2023

For a hex tilemap it appears you can get the case where the FilePos is equal to its bounds.

E.g. with TilemapSize { x: 10, y: 10 } you can get TilePos { x: 10, .. } and TilePos { y: 10, .. } after calling fill_tilemap_hexagon

This means that calls to TilePos::within_map_bounds will fail, causing issues such as TilePos::from_world_pos returning None even though there is a tile there.

Link to simple example: repo

In the example, clicking on tiles highlights them. It is expected to work for all tiles, but it does not work for the upper left edge and the right edge, as we have the case described above.

Hex tilemap with most tiles grey but two edges are white

@Piturnah Piturnah changed the title Bug: Hex FilePos can have its fields equal to map size Bug: Hex TilePos can have its fields equal to map size Sep 11, 2023
@StarArawn StarArawn added the bug Something isn't working label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants