Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Switching from infinite erroneously updates map dimensions that are less than 16x16. #2051
This appears to be a bug in 1.2.1.
Open the JSON file.
The map's width and height will update to 16 x 16 if you uncheck the infinite property.
It is interesting that a tile needs to be in the tile layer in order for this to occur.
Yeah, that shouldn't happen. It happens because this size is based on the bounding rectangle of the allocated chunks, rather than the exact area used by the tile layers. I should probably just fix this to determine the exact area instead.
However, the title of your issue reads "Switching to infinite", whereas this bug happens when switching FROM infinite. Is there also an issue when switching TO infinite?
Right, if there is no tile placed, there is no chunk allocated. So the bounding rectangle of the chunks is empty.
A chunk is currently always 16x16.
I found this issue because I am writing a package for
Whilst reading the documentation I came across the section about tile flipping and clearing the high-bits.
And indeed I take this approach in my implementation as shown by the excerpt below.
Currently, I have both chunk data and tile layer data running through through this check. So when the map is set to infinite,
Having said all of that I agree that it is a bug when you switch from infinite.
Hmm, I guess the documentation could be updated, but modifying that code to support both infinite and fixed-size maps is going to make it a little too complicated for my tastes and goes beyond what it was trying to demonstrate. In that case it may be more helpful to link to the Tiled source code directly for all the details, and reduce the example shown in the docs.