Kruptein / PlanarAlly

A companion tool for when you travel into the planes.
https://www.planarally.io/
MIT License
393 stars 71 forks source link

feat(MapTool): Improve hex grid support #1391

Closed Kruptein closed 4 months ago

Kruptein commented 4 months ago

Another update in the recent chain of hex-grid improvements.

Previous PRs already fixed the most important aspects that also relate to the map tool, but some small extra changes were necessary.

When resizing a square grid it's easy to determine a number of cells in both directions, for hex grids this is usually easy in 1 direction but less straight forward in the other. Additionally maps will rarely be cutoff cleanly in at least 1 of the 2 directions for the hex case, which can mess up the assumptions used by the map tool.

As a result I strongly recommend to ensure your dominant axis is counted properly and not worry too much about the auxiliary axis. Your dominant axis should be resized correctly, the other will very likely need some additional manual resizing, but that is just over 1 axis so should be very straightforward.

Important to note is that when you use the anchor to lock the aspect ratio, the map tool will try to approximate the number of visual cells that are present in the non-dominant axis. What I mean by this is that it will count the number of cells in a zigzag pattern. This felt more natural than counting the number of cells if they were in a clean line as that is very counterintuitive to verify.

tl;dr some manual work will likely still be needed, but it should be relatively straightforward.