maptool icon indicating copy to clipboard operation
maptool copied to clipboard

Hexagonal (Flat Top) Map Grid 2nd Size Input Mutation

Open rkyeun opened this issue 3 years ago • 1 comments

Describe the bug The 2nd Size edit field in a hexagonal grid rejects your reality and substitutes its own.

To Reproduce

  1. Create a new map or choose Edit Grid and choose a hexagonal (flat top) grid. In this case, I used a grid size of 100 pixels and will assume you did too. Different choice of sizes will have different values result from the buggy behavior but display the same issue.
  2. Open the Adjust Map. Note that the 2nd Size field has the proper starting value of 115.47
  3. Enter the value of 116 into the 2nd Size field to get an integer grid width in pixels.
  4. Make another field the active field by clicking another field or tabbing.
  5. The entered value of 116 is rejected and replaced by 115.682.
  6. Alternate clicking the up arrow and down arrow on the right of the first Grid Size field repeatedly. Watch the mutant value converge back to 115.47 when the Grid Size is at 100 again.
  7. Enter the value of 400 into the 2nd Size field to get a very long hexagon.
  8. Change fields and watch the 400 be replaced by 279.024, over a hundred pixels less!
  9. Repeat step 6, watch it converge back to 115.47 at Grid Size 100. WORKAROUND
  10. Enter the magic value of 116.787 into the 2nd Size field.
  11. The mutant value becomes 116.0, close the window now to achieve expected result.
  12. Other desired outcomes have different magic numbers which must be found through trial and error playing hot-cold with the entries.

Expected behavior The 2nd Size edit field should not mutate input when a different field is activated. The 2nd Size should remain as set by user input unless Grid Size is updated directly. When Grid Size is updated, 2nd Size should become the correct width of a regular hexagon immediately, rather than slowly converging over multiple attempts.

Screenshots Bug_Animation

MapTool Info Version: 1.8.3 Install: New

Desktop (please complete the following information):

  • OS: [e.g. Windows, Linux [Ubuntu, Debian, CentOS, etc], MacOS]
  • Version [10, 18.04]

rkyeun avatar Jul 03 '21 21:07 rkyeun

There's some serious weirdness going on there. Apparently, MapTool does not insist on perfect hexagons (so I stand corrected on that). You can put in some seriously warped numbers for the 2nd size. But it never leaves that number unchanged (except when it's already defining a perfect hexagon). If you put in a number smaller than what's required for a perfect hexagon (115.47 for a 100 unit tall hex), it changes it to that perfect value.

But if you put in a larger number, it reduces it by some variable fractional multiplier. The bigger the number, the bigger the percentage of the reduction. If I put in 200, it changes it to 157.641, or about 22% smaller. But if I put in 500, it changes it to 343.259, or about 30 %. And so on. At a 2nd Size of 5,000, it reduces it to 3334.333, or by 34%.

The hexes, however, work correctly for tracking movement and measuring distance. (And interestingly, the border around a selected token is adjusted to fit the width and height of the hex, instead of remaining square.)

Where it gets really weird is if I hit the <Alt> key while the Adjust Grid panel is open (and the cursor anywhere in the panel), it steps the 2nd Size down until it reaches the perfect ratio.

I have no idea what it's supposed to be doing, but it looks like it's doing that and . . . other things, too.

taustinoc avatar Apr 10 '22 04:04 taustinoc