mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-23 12:31:24 +01:00
Rescale style option for submaps.
This commit is contained in:
parent
53dc9a452d
commit
e85f5e39d6
1 changed files with 156 additions and 146 deletions
|
|
@ -20,6 +20,7 @@ window.UISubmap = (function () {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,6 +39,17 @@ window.UISubmap = (function () {
|
||||||
Cancel: function () {
|
Cancel: function () {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* callbacks */
|
||||||
|
|
||||||
|
const resampleCurrentMap = debounce(function () {
|
||||||
|
// Resample the whole map to different cell resolution or shape
|
||||||
|
const cellNumId = Number(document.getElementById("submapPointsInput").value);
|
||||||
|
if (!cellsDensityConstants[cellNumId]) {
|
||||||
|
console.error("Unknown cell number!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -146,7 +158,8 @@ window.UISubmap = (function () {
|
||||||
// resize burgIcons
|
// resize burgIcons
|
||||||
const burgIcons = [...document.getElementById("burgIcons").querySelectorAll("g")];
|
const burgIcons = [...document.getElementById("burgIcons").querySelectorAll("g")];
|
||||||
for (const bi of burgIcons) {
|
for (const bi of burgIcons) {
|
||||||
const newRadius = rn(minmax(bi.getAttribute('size') * scale, 0.2, 10), 2);
|
const newRadius = rn(minmax(scale, 0.2, 10) * 0.8, 2);
|
||||||
|
styleRadiusInput.value = newRadius;
|
||||||
changeRadius(newRadius, bi.id);
|
changeRadius(newRadius, bi.id);
|
||||||
const swAttr = bi.attributes['stroke-width'];
|
const swAttr = bi.attributes['stroke-width'];
|
||||||
swAttr.value = +swAttr.value * scale;
|
swAttr.value = +swAttr.value * scale;
|
||||||
|
|
@ -186,6 +199,3 @@ window.UISubmap = (function () {
|
||||||
position: {my: "center", at: "center", of: "svg"}
|
position: {my: "center", at: "center", of: "svg"}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {openSubmapOptions, openRemapOptions}
|
|
||||||
})();
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue