mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.5.81 - svg coa load fix
This commit is contained in:
parent
49b9895b0b
commit
2f70df6c59
2 changed files with 4 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -238,7 +238,6 @@ function editEmblem(type, id, el) {
|
|||
const svg = `<svg id="${id}" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><image x="0" y="0" width="200" height="200" href="${result}"/></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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue