From 5ae17e4d78aefc97f22dbafddb054efe28c2f69d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 24 Mar 2021 09:56:24 -0400 Subject: map: Fix layer rect math --- 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; -- cgit v0.9.1