From b5b169ae8020c50f05487b4155c4e0bbf558c5fb Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 09:47:04 +0200 Subject: [PATCH] Add version marker + wider canvas for X-swap labels Add explicit X-swap marker comment so the user can verify they're seeing the new build. Bump canvas width by 2*256 padding so the X labels (drawn at canvasX + 244) are within the canvas even for the rightmost drawn tile (east, perp=-2 -> canvasX 1152, label at 1396). With wider canvas (1792 vs 1280), labels are visible and the corridor is centred. --- vendor/clouds3d.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index 7df2f70..2e3ec5a 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -337,7 +337,7 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { // UNPACK_FLIP_Y_WEBGL=true inverts V: canvas top -> texture V=1 (top). // For lng axis (Y): invert canvasY so lng=+12 (corridor front in // N flight) lands at small canvasY (= screen top after flip). - // For perp axis (X): keep the natural sign so world east (dx>0) + // === X-SWAP BUILD v3 === // X-swap: east (perp=-2) -> canvasX 1152 (right) // ends up at canvasX > halfPerp area (right side of canvas). var canvasX = (-perp + halfPerp + 0.5) * GROUND_TILE_SIZE; var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE; @@ -495,7 +495,8 @@ function initGroundSystem(glCtx) { if (groundCanvas) return; // already initialised groundGl = glCtx; groundCanvas = document.createElement('canvas'); - groundCanvas.width = GROUND_TILE_SIZE * GROUND_CORRIDOR_PERP; + // Wider canvas so all X labels (at canvasX + 244) are visible + groundCanvas.width = GROUND_TILE_SIZE * GROUND_CORRIDOR_PERP + 2 * GROUND_TILE_SIZE; groundCanvas.height = GROUND_TILE_SIZE * GROUND_CORRIDOR_LONG; groundCtx = groundCanvas.getContext('2d'); // Pre-fill with fog colour so partially-loaded mosaic still