mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
FIX: don't crash on wrong icon group name, just report it.
This commit is contained in:
parent
aab27ca673
commit
1e28e7c3a0
1 changed files with 4 additions and 0 deletions
|
|
@ -652,6 +652,10 @@ styleIconSizeMinus.addEventListener("click", function () {
|
||||||
|
|
||||||
function changeIconSize(size, group) {
|
function changeIconSize(size, group) {
|
||||||
const el = group ? anchors.select("#" + group) : getEl();
|
const el = group ? anchors.select("#" + group) : getEl();
|
||||||
|
if (!el.size()) {
|
||||||
|
console.warn(`Group ${group} not found. Can not set icon size!`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const oldSize = +el.attr("size");
|
const oldSize = +el.attr("size");
|
||||||
const shift = (size - oldSize) / 2;
|
const shift = (size - oldSize) / 2;
|
||||||
el.attr("size", size);
|
el.attr("size", size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue