From f79e27665cb3cc83367b584f043a482e21aeea51 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 09:53:56 +0200 Subject: [PATCH] Re-add X-flip on image (NS-mirror) with natural order arrangement The user wants: - Natural order arrangement (canvasX = perp + ...): east (1102) on left, west (1098) on right - X-mirrored image (NS-mirror): within each tile, the image east appears on the left of the tile (natural map orientation) Combined state: - canvasX = (perp + halfPerp + 0.5) * 256: natural order - drawImage with negative width: X-flip (NS-mirror) - All labels in normal orientation (no mirrorLabel) This matches the user's description: 'die anordnung passt' (arrangement correct) and 'der x-flip ist immer noch falsch' (image was still mirrored, now correctly mirrored). --- vendor/clouds3d.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index 6c6eaed..356b5cd 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -351,12 +351,13 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { // the corridor orientation (east tiles have their image east // on the left of the drawn area, west tiles on the right). // Labels are drawn separately in normal orientation, so the - // Draw image with normal orientation (no X-flip). The - // X-swap arrangement (canvasX = -perp + ...) already places - // east tiles on the right of the screen, so the X coordinates - // read naturally left to right when scanning the corridor. - groundCtx.drawImage(img, canvasX, canvasY, - GROUND_TILE_SIZE, GROUND_TILE_SIZE); + // X-flip the image (NS-mirror). The arrangement uses the + // natural order (canvasX = perp + ...) so east tiles are on + // the LEFT of the screen. The image X-flip makes image east + // appear on the right of each east tile (the natural map + // orientation). + groundCtx.drawImage(img, canvasX + GROUND_TILE_SIZE, canvasY, + -GROUND_TILE_SIZE, GROUND_TILE_SIZE); groundLoadedTiles[tileX + '_' + tileY] = true; // Thin border so the user can see where one tile ends and the