Add O/W mirror: 180° rotation (image content only)
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).
This commit is contained in:
1 parent
5ba7596ced
commit
2f7c09fc16
1 file changed
+6
-5
Vendored
+6
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user