Closed Badel2 closed 12 months ago
Fixed in a0a7a27550f17ca74d9c66d4741a8b45237f6ea7
Now when the canvas is too big for javascript, we copy all the data to Rust and create the huge PNG there. It's very slow and the entire app freezes while waiting for the screenshot to generate, but it works.
In the biome viewer: https://badel2.github.io/slime_seed_finder/biomes.html
The "DOWNLOAD MAP" button uses an off-screen canvas to generate a high resolution image. However if that canvas is too large, an empty image is downloaded instead. This behavior is explained in the documentation of
canvas.toDataUrl
:https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL#return_value
So the best solution would be to create an image directly, instead of using a canvas there.