option to not rescale labels on zoom

This commit is contained in:
Azgaar 2021-08-03 23:50:52 +03:00
parent 3fb68a89f6
commit 37e5b803bc
4 changed files with 11 additions and 2 deletions

View file

@ -479,7 +479,8 @@ function invokeActiveZooming() {
if (this.id === "burgLabels") return;
const desired = +this.dataset.size;
const relative = Math.max(rn((desired + desired / scale) / 2, 2), 1);
this.setAttribute("font-size", relative);
if (rescaleLabels.checked) this.setAttribute("font-size", relative);
const hidden = hideLabels.checked && (relative * scale < 6 || relative * scale > 60);
if (hidden) this.classList.add("hidden");
else this.classList.remove("hidden");