mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
Hatching copy for clone is now done before unused pattern removal
This commit is contained in:
parent
db84364aa5
commit
2e413b57d7
1 changed files with 3 additions and 3 deletions
|
|
@ -184,6 +184,9 @@ async function getMapURL(type, options = {}) {
|
|||
filters[i].remove();
|
||||
}
|
||||
|
||||
const hatching = svgDefs.getElementById("defs-hatching");
|
||||
if (hatching) cloneDefs.appendChild(hatching.cloneNode(true));
|
||||
|
||||
// remove unused patterns
|
||||
const patterns = cloneEl.querySelectorAll("pattern");
|
||||
for (let i = 0; i < patterns.length; i++) {
|
||||
|
|
@ -262,9 +265,6 @@ async function getMapURL(type, options = {}) {
|
|||
if (pattern) cloneDefs.appendChild(pattern.cloneNode(true));
|
||||
}
|
||||
|
||||
const hatching = svgDefs.getElementById("defs-hatching");
|
||||
if (hatching) cloneDefs.appendChild(hatching.cloneNode(true));
|
||||
|
||||
if (!cloneEl.getElementById("fogging-cont")) cloneEl.getElementById("fog")?.remove(); // remove unused fog
|
||||
if (!cloneEl.getElementById("regions")) cloneEl.getElementById("statePaths")?.remove(); // removed unused statePaths
|
||||
if (!cloneEl.getElementById("labels")) cloneEl.getElementById("textPaths")?.remove(); // removed unused textPaths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue