summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map.c b/src/map.c
index 41d6af8..53dd570 100644
--- a/src/map.c
+++ b/src/map.c
@@ -542,8 +542,8 @@ _db_map_render_layer(struct db_map *map, struct db_map_layer *layer,
tile_rect.h = tileheight;
tile_rect.x *= tile_rect.w;
tile_rect.y *= tile_rect.h;
- layer_rect.x = i % columns;
- layer_rect.y = i / columns;
+ layer_rect.x = i % map->w;
+ layer_rect.y = i / map->w;
layer_rect.w = tilewidth;
layer_rect.h = tileheight;
layer_rect.x *= layer_rect.w;