Mirror O/W arrangement: east tiles to canvas right, west to left

User wants only the O/W arrangement mirrored (image X-flip
stays as it was). The drawing formula for canvasX now uses
(-perp + halfPerp + 0.5) instead of (perp + halfPerp + 0.5),
so tiles with perp<0 (world east, dx>0) land at large canvasX
(right side of canvas). Y axis (forward direction in N flight)
stays unchanged.
This commit is contained in:
Richard Zink committed 2026-10-08 08:15:49 +02:00
1 parent acac6dccfc
commit 29924d07b0
1 file changed
+1 -1
+1 -1
View File
@@ -335,7 +335,7 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) {
// N flight) lands at small canvasY (= screen top after flip).
// For perp axis (X): keep the natural sign so world east (dx>0)
// ends up at canvasX > halfPerp area (right side of canvas).
var canvasX = (perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
var canvasX = (-perp + halfPerp + 0.5) * GROUND_TILE_SIZE;
var canvasY = (lng + halfLong + 0.5) * GROUND_TILE_SIZE;
if (canvasX < 0 || canvasX >= groundCanvas.width || canvasY < 0 || canvasY >= groundCanvas.height) {
return Promise.resolve(false);