Fix canvas dimensions for swapped corridor axes

After swapping axes so lng runs along canvas Y (corridor long
axis), canvas height was still GROUND_CORRIDOR_PERP * 256 = 1280
(only 5 tiles tall). The 25-tile-long corridor was drawn off-canvas,
so only the back 5 tiles (lng -12..-7) were visible. That made
new tiles 'disappear' off the right side and the build appear 90
deg off from flight.

Set canvas height to corridor long (25 tiles = 6400 px) and
canvas width to perp (5 tiles = 1280 px). Now the full corridor
fits on canvas and the visual depth direction matches the
camera's flight direction along canvas Y.
This commit is contained in:
Richard Zink committed 2026-10-07 21:34:51 +02:00
1 parent 8a9fbd3956
commit c2d6fd38ba
1 file changed
+2 -2
+2 -2
View File
@@ -405,8 +405,8 @@ function initGroundSystem(glCtx) {
if (groundCanvas) return; // already initialised if (groundCanvas) return; // already initialised
groundGl = glCtx; groundGl = glCtx;
groundCanvas = document.createElement('canvas'); groundCanvas = document.createElement('canvas');
groundCanvas.width = GROUND_TILE_SIZE * GROUND_CORRIDOR_LONG; groundCanvas.width = GROUND_TILE_SIZE * GROUND_CORRIDOR_PERP;
groundCanvas.height = GROUND_TILE_SIZE * GROUND_CORRIDOR_PERP; groundCanvas.height = GROUND_TILE_SIZE * GROUND_CORRIDOR_LONG;
groundCtx = groundCanvas.getContext('2d'); groundCtx = groundCanvas.getContext('2d');
// Pre-fill with fog colour so partially-loaded mosaic still // Pre-fill with fog colour so partially-loaded mosaic still
// shows the right base colour // shows the right base colour