| @@ -715,6 +715,7 @@ document.addEventListener("DOMContentLoaded", () => { | |||||
| config.height = math.multiply(config.height, dir); | config.height = math.multiply(config.height, dir); | ||||
| updateWorldOptions(); | updateWorldOptions(); | ||||
| } | } | ||||
| checkFitWorld(); | |||||
| updateSizes(); | updateSizes(); | ||||
| }) | }) | ||||
| document.querySelector("body").appendChild(testCtx.canvas); | document.querySelector("body").appendChild(testCtx.canvas); | ||||
| @@ -918,6 +919,11 @@ document.addEventListener("touchmove", (e) => { | |||||
| } | } | ||||
| }, { passive: false }); | }, { passive: false }); | ||||
| function checkFitWorld() { | |||||
| if (config.autoFit) { | |||||
| fitWorld(); | |||||
| } | |||||
| } | |||||
| function fitWorld() { | function fitWorld() { | ||||
| let max = math.unit(0, "meter"); | let max = math.unit(0, "meter"); | ||||