Fix bug where there are white lines between tiles when scale*256 isn't whole number #19
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.
When (scale*256)%1 > 0.5 there are white lines between tiles, rounding down when calculating tileSize fixes the issue.
I don't understand the code completely but I believe that this results in the tiles packing together towards the middle of the image. Therefore a few extra pixels of map are shown from the edge tiles and so the edge tiles may be a little out of alignment from the expected coods. I think this is an OK tradeoff as its only vary slight and not having the white lines is obviously more important.
The alignment between the tiles does not seem to be affected at all, there is no missing slice of map between them.
(I wander if somewhere during the tile generation process the tile size is rounded down, could be the source of the error?)