diff --git a/src/js/game/hud/parts/screenshot_exporter.js b/src/js/game/hud/parts/screenshot_exporter.js index dfdd8224..fe1a52df 100644 --- a/src/js/game/hud/parts/screenshot_exporter.js +++ b/src/js/game/hud/parts/screenshot_exporter.js @@ -55,8 +55,18 @@ export class HUDScreenshotExporter extends BaseHUDPart { const dimensions = maxChunk.sub(minChunk); logger.log("Dimensions:", dimensions); - - const chunkSizePixels = 128; + + let chunkSizePixels = 128; + + if (dimensions.x + dimensions.y > 256) { + if (dimensions.x > dimensions.y) { + chunkSizePixels = Math.floor(128 * (128 / dimensions.x)); + }else{ + chunkSizePixels = Math.floor(128 * (128 / dimensions.y)); + } + logger.log("ChunkSizePixels:", chunkSizePixels); + } + const chunkScale = chunkSizePixels / (globalConfig.mapChunkSize * globalConfig.tileSize); logger.log("Scale:", chunkScale);