Skip to content

Commit

Permalink
Fix swapped TileWidth and TileHeight. (#49)
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
jabolopes authored Feb 4, 2021
1 parent 0006c27 commit d78324f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tmx_layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (l *Layer) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
func (l *Layer) GetTilePosition(tileID int) (int, int) {
x := tileID % l._map.Width
y := tileID / l._map.Width
return l.OffsetX + x*l._map.TileHeight, l.OffsetY + y*l._map.TileWidth
return l.OffsetX + x*l._map.TileWidth, l.OffsetY + y*l._map.TileHeight
}

// GetTileRect returns the rectangle that contains the Tile in the original Tileset.Image
Expand Down

0 comments on commit d78324f

Please sign in to comment.