This commit is contained in:
yggdrasil75
2025-11-09 21:02:10 -05:00
parent f2b6286580
commit f5a28d98a3
2 changed files with 36 additions and 19 deletions

View File

@@ -322,6 +322,9 @@ private:
Vec2 worldPos = objPos + positions[i];
Vec2 gridPos = worldPos.round();
// Flip Y coordinate to make (0,0) bottom-left
gridPos.y = height - 1 - gridPos.y;
// Only add if within grid bounds
if (gridPos.x >= 0 && gridPos.x < width &&
gridPos.y >= 0 && gridPos.y < height) {