From 2f7c09fc16cb34fda80b62687910731eb683f7a6 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 08:08:43 +0200 Subject: [PATCH] =?UTF-8?q?Add=20O/W=20mirror:=20180=C2=B0=20rotation=20(i?= =?UTF-8?q?mage=20content=20only)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User wants the O/W axis mirrored within each tile. With the previous Y-only flip, East was still on the right and West on the left. Adding an X-flip makes it 180° rotation: - Image North -> canvas bottom, South -> canvas top - Image East -> canvas left, West -> canvas right Labels N/S were already positioned at canvas bottom/top to match the Y-flipped image, so they stay where they are. Tile arrangement in the corridor is unchanged (still controlled by canvasX/canvasY formulas with no swap on either axis). --- vendor/clouds3d.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index 546b8c1..60b92b2 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -346,11 +346,12 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { // (canvasX + 256, canvasY + 256). After this, image north // (high lat) is at canvas bottom and image south at canvas // top; image east at canvas right, image west at canvas left. - // Flip image only on the Y axis (NS mirror). Image top - // (north) -> canvas bottom, image bottom (south) -> canvas - // top. X axis (EW) is preserved. - groundCtx.drawImage(img, canvasX, canvasY + GROUND_TILE_SIZE, - GROUND_TILE_SIZE, -GROUND_TILE_SIZE); + // Flip image 180° (both X and Y). Image top (north) -> canvas + // bottom, image bottom (south) -> canvas top, image left + // (west) -> canvas right, image right (east) -> canvas left. + // Labels N/S already match the Y-flipped orientation. + groundCtx.drawImage(img, canvasX + GROUND_TILE_SIZE, canvasY + GROUND_TILE_SIZE, + -GROUND_TILE_SIZE, -GROUND_TILE_SIZE); groundLoadedTiles[tileX + '_' + tileY] = true; // Debug labels: 'N' at the image's north edge (top of canvas