Fix Height Map preview download image size (#746)

This commit is contained in:
juacom99 2022-02-21 17:32:06 -03:00 committed by GitHub
parent 97a864dde8
commit e1b0688615
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1316,10 +1316,10 @@ function editHeightmap() {
img.onload = function () { img.onload = function () {
const canvas = document.createElement("canvas"); const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d"); const ctx = canvas.getContext("2d");
canvas.width = svgWidth; canvas.width = graphWidth;
canvas.height = svgHeight; canvas.height = graphHeight;
document.body.insertBefore(canvas, optionsContainer); document.body.insertBefore(canvas, optionsContainer);
ctx.drawImage(img, 0, 0, svgWidth, svgHeight); ctx.drawImage(img, 0, 0, graphWidth, graphHeight);
const imgBig = canvas.toDataURL("image/png"); const imgBig = canvas.toDataURL("image/png");
const link = document.createElement("a"); const link = document.createElement("a");
link.download = getFileName("Heightmap") + ".png"; link.download = getFileName("Heightmap") + ".png";