mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
fix large screenshots
This commit is contained in:
parent
4b9df76f2f
commit
a5e5cd9e4f
@ -55,8 +55,18 @@ export class HUDScreenshotExporter extends BaseHUDPart {
|
|||||||
|
|
||||||
const dimensions = maxChunk.sub(minChunk);
|
const dimensions = maxChunk.sub(minChunk);
|
||||||
logger.log("Dimensions:", dimensions);
|
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);
|
const chunkScale = chunkSizePixels / (globalConfig.mapChunkSize * globalConfig.tileSize);
|
||||||
logger.log("Scale:", chunkScale);
|
logger.log("Scale:", chunkScale);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user