diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index 1e782af..0fe0d6f 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -379,16 +379,19 @@ function drawTileAt(lng, perp, dx, dz, centerTileX, centerTileY) { groundCtx.fillText(text, 0, 0); groundCtx.restore(); } - // S at top-left (image south after Y mirror is at canvas top) - mirrorLabel('S', canvasX + 12, canvasY + 44, 'left'); - // N at bottom-left (image north at canvas bottom) - mirrorLabel('N', canvasX + 12, canvasY + 244, 'left'); + // S at top-left, textAlign 'right' so the text's right edge + // is at the anchor (text extends into the tile from the left + // edge of the tile area). + mirrorLabel('S', canvasX + 12, canvasY + 44, 'right'); + // N at bottom-left + mirrorLabel('N', canvasX + 12, canvasY + 244, 'right'); // Tile coordinates, top-right and bottom-right corners groundCtx.font = 'bold 18px monospace'; - // y at top-right - mirrorLabel('y=' + tileY, canvasX + GROUND_TILE_SIZE - 12, canvasY + 28, 'right'); + // y at top-right, textAlign 'left' so text extends into the + // tile from the right edge. + mirrorLabel('y=' + tileY, canvasX + GROUND_TILE_SIZE - 12, canvasY + 28, 'left'); // x at bottom-right - mirrorLabel('x=' + tileX, canvasX + GROUND_TILE_SIZE - 12, canvasY + GROUND_TILE_SIZE - 12, 'right'); + mirrorLabel('x=' + tileX, canvasX + GROUND_TILE_SIZE - 12, canvasY + GROUND_TILE_SIZE - 12, 'left'); return true; }).catch(function() {