From e1b0688615c7eff75fc5e0c2290870fafb34a150 Mon Sep 17 00:00:00 2001 From: juacom99 Date: Mon, 21 Feb 2022 17:32:06 -0300 Subject: [PATCH] Fix Height Map preview download image size (#746) --- modules/ui/heightmap-editor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js index 43200d26..effb81c7 100644 --- a/modules/ui/heightmap-editor.js +++ b/modules/ui/heightmap-editor.js @@ -1316,10 +1316,10 @@ function editHeightmap() { img.onload = function () { const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); - canvas.width = svgWidth; - canvas.height = svgHeight; + canvas.width = graphWidth; + canvas.height = graphHeight; 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 link = document.createElement("a"); link.download = getFileName("Heightmap") + ".png";