FIX: don't crash on wrong icon group name, just report it.

This commit is contained in:
Mészáros Gergely 2022-05-12 23:38:54 +02:00
parent aab27ca673
commit 1e28e7c3a0

View file

@ -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);