Don't call setTileSize or setSpacing unless values are given

This commit is contained in:
Richard Davey 2024-07-22 19:03:11 +01:00
parent f44b10631d
commit 52085dba91

View file

@ -423,8 +423,16 @@ var Tilemap = new Class({
if (tileset)
{
tileset.setTileSize(tileWidth, tileHeight);
tileset.setSpacing(tileMargin, tileSpacing);
if (tileWidth || tileHeight)
{
tileset.setTileSize(tileWidth, tileHeight);
}
if (tileMargin || tileSpacing)
{
tileset.setSpacing(tileMargin, tileSpacing);
}
tileset.setImage(texture);
return tileset;