From 2128220b390a54585408c57dd8b9347c58054dfb Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 09:18:58 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20misleading=20comment:=20image=20is=20X-fl?= =?UTF-8?q?ipped=20(NS-mirror),=20not=20180=C2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The drawImage call uses width=-TILE, height=+TILE, which is an X-only horizontal mirror. The old comment said '180 degrees' which implied both axes flipped; the code is only horizontal. NS axis = vertical axis, mirror across it = horizontal mirror. Current state matches the user's observation: tile content is NS-mirrored, X arrangement goes low->high left to right. --- vendor/clouds3d.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index b63a18f..09574eb 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -345,15 +345,12 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { return Promise.resolve(false); } return fetchTileImage(tileX, tileY).then(function(img) { - // Rotate image 180 degrees: draw with negative width and - // negative height, anchored at the tile's bottom-right corner - // (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. - // Mirror image across the NS axis (X-only flip). Image top - // (north) stays at canvas top, image bottom (south) stays - // at canvas bottom. Image left (west) -> canvas right, image - // right (east) -> canvas left. + // Mirror image across the NS axis (horizontal / X-flip): + // draw with negative width and positive height, anchored at + // the tile's right edge (canvasX + 256). Image top (north) + // stays at canvas top, image bottom (south) at canvas bottom. + // Image left (west) -> canvas right, image right (east) -> + // canvas left. groundCtx.drawImage(img, canvasX + GROUND_TILE_SIZE, canvasY, -GROUND_TILE_SIZE, GROUND_TILE_SIZE); groundLoadedTiles[tileX + '_' + tileY] = true;