fix the click with the offset of map

This commit is contained in:
Clément Le Bihan
2020-03-12 16:52:57 +01:00
parent b9532de65a
commit ba792b5fe3
+1 -1
View File
@@ -73,7 +73,7 @@ struct transform_component *pos, struct vertex_component *info)
if (!info || !info->map)
return;
tl = get_tile_from_pos(info, (gc_vector2){wp.x, wp.y});
tl = get_tile_from_pos(info, (gc_vector2){wp.x - pos->position.x, wp.y + pos->position.y});
for (i = 0; info->map[i].corners[0]; i++);
for (i--; i >= 0; i--) {
draw_tile(this, pos->position, &info->map[i], &info->map[i] == tl);