mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
fix font size settings
This commit is contained in:
parent
7d299ff395
commit
1f10a8e281
2 changed files with 17 additions and 9 deletions
6
main.js
6
main.js
|
|
@ -476,12 +476,12 @@ function invokeActiveZooming() {
|
|||
|
||||
// rescale lables on zoom
|
||||
if (labels.style("display") !== "none") {
|
||||
labels.selectAll("g").each(function (d) {
|
||||
labels.selectAll("g").each(function () {
|
||||
if (this.id === "burgLabels") return;
|
||||
const desired = +this.dataset.size;
|
||||
const relative = Math.max(rn((desired + desired / scale) / 2, 2), 1);
|
||||
this.getAttribute("font-size", relative);
|
||||
const hidden = hideLabels.checked && (relative * scale < 6 || relative * scale > 50);
|
||||
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");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue