From 2f70df6c599d258f1da1bd0936ae7ce670c8dc8f Mon Sep 17 00:00:00 2001 From: Azgaar Date: Mon, 1 Mar 2021 02:46:41 +0300 Subject: [PATCH] v1.5.81 - svg coa load fix --- modules/save-and-load.js | 2 +- modules/ui/emblems-editor.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/save-and-load.js b/modules/save-and-load.js index 22720dd1..139d1a6c 100644 --- a/modules/save-and-load.js +++ b/modules/save-and-load.js @@ -1104,9 +1104,9 @@ function parseLoadedData(data) { for (const river of pack.rivers) { const el = document.getElementById("river"+river.i); if (el) { + river.widthFactor = +el.getAttribute("data-width"); el.removeAttribute("data-width"); el.removeAttribute("data-increment"); - river.widthFactor = +this.getAttribute("data-width"); river.discharge = pack.cells.fl[river.mouth] || 1; river.width = rn(river.length / 100, 2); river.sourceWidth = .1; diff --git a/modules/ui/emblems-editor.js b/modules/ui/emblems-editor.js index 83758d66..5b74f58a 100644 --- a/modules/ui/emblems-editor.js +++ b/modules/ui/emblems-editor.js @@ -238,7 +238,6 @@ function editEmblem(type, id, el) { const svg = ``; defs.insertAdjacentHTML("beforeend", svg); } else { - const el = document.createElement("html"); el.innerHTML = result; @@ -250,14 +249,13 @@ function editEmblem(type, id, el) { }); }); - const g = el.querySelector("g"); - - if (!g) { + const svg = el.querySelector("svg"); + if (!svg) { tip("The file should be prepated for load to FMG. Please use Armoria or other relevant tools", false, "error"); return; } - const newEmblem = defs.appendChild(g); + const newEmblem = defs.appendChild(svg); newEmblem.id = id; newEmblem.setAttribute("width", 200); newEmblem.setAttribute("height", 200);