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:
1 parent
8a9fbd3956
commit
c2d6fd38ba
1 file changed
+2
-2
Vendored
+2
-2
@@ -405,8 +405,8 @@ function initGroundSystem(glCtx) {
|
||||
if (groundCanvas) return; // already initialised
|
||||
groundGl = glCtx;
|
||||
groundCanvas = document.createElement('canvas');
|
||||
groundCanvas.width = GROUND_TILE_SIZE * GROUND_CORRIDOR_LONG;
|
||||
groundCanvas.height = GROUND_TILE_SIZE * GROUND_CORRIDOR_PERP;
|
||||
groundCanvas.width = GROUND_TILE_SIZE * GROUND_CORRIDOR_PERP;
|
||||
groundCanvas.height = GROUND_TILE_SIZE * GROUND_CORRIDOR_LONG;
|
||||
groundCtx = groundCanvas.getContext('2d');
|
||||
// Pre-fill with fog colour so partially-loaded mosaic still
|
||||
// shows the right base colour
|
||||
|
||||
Reference in new issue
Block a user