Fix for label not always showing + distance calculation wrong for diagonals #343
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes two issues:
I simply removed the
from ruler.js that was added by @TPNils in #329 . There was no explanation why this is needed - and removing it fixes the problem of the label disappearing with not apparent side effects.
canvas.grid.measureDistances
seems to return a wrong distance for diagonals in Foundry v12. There is a deprecation warning suggesting to usecanvas.grid.measurePath
instead, so I rewrote it to this. This fixes the problem - though the options are no longer relevant and I didn't test gridless stuff etc. because it's not needed for our game.Additionally, I've updated some calls so that no more deprecation warnings get printed when dragging the ruler (except when routinglib is active).
If you need some small adjustments, just tell me - but overall the Foundry development experiment with the de-facto non-existing developer documentation didn't really encourage me to do more testing than "this works in exactly my case and that's good enough for me".