Fix negative coordinates when drawing updated chunks

This commit is contained in:
Danielv123 committed 2025-08-10 00:28:48 +02:00
1 parent 3bf7a84de4
commit b70c7bd84f
1 file changed
+2 -2
+2 -2
View File
@@ -290,8 +290,8 @@ export default function CanvasMinimapPage() {
const tileKey = `${tileX},${tileY}`;
// Calculate position within the tile
const localChunkX = chunkX % CHUNKS_PER_TILE;
const localChunkY = chunkY % CHUNKS_PER_TILE;
const localChunkX = ((chunkX % CHUNKS_PER_TILE) + CHUNKS_PER_TILE) % CHUNKS_PER_TILE;
const localChunkY = ((chunkY % CHUNKS_PER_TILE) + CHUNKS_PER_TILE) % CHUNKS_PER_TILE;
const pixelX = localChunkX * CHUNK_SIZE;
const pixelY = localChunkY * CHUNK_SIZE;