mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-23 12:31:24 +01:00
Placed labels use most recent label group
This commit is contained in:
parent
9aa0278f7e
commit
5860814d46
1 changed files with 4 additions and 1 deletions
|
|
@ -474,7 +474,10 @@ function addLabelOnClick() {
|
||||||
const name = Names.getCulture(culture);
|
const name = Names.getCulture(culture);
|
||||||
const id = getNextId("label");
|
const id = getNextId("label");
|
||||||
|
|
||||||
let group = labels.select("#addedLabels");
|
// use most recently selected label group
|
||||||
|
let selected = labelGroupSelect.value;
|
||||||
|
const symbol = selected ? "#" + selected : "#addedLabels";
|
||||||
|
let group = labels.select(symbol);
|
||||||
if (!group.size()) group = labels.append("g").attr("id", "addedLabels").attr("fill", "#3e3e4b").attr("opacity", 1).attr("stroke", "#3a3a3a").attr("stroke-width", 0).attr("font-family", "Almendra SC").attr("font-size", 18).attr("data-size", 18).attr("filter", null);
|
if (!group.size()) group = labels.append("g").attr("id", "addedLabels").attr("fill", "#3e3e4b").attr("opacity", 1).attr("stroke", "#3a3a3a").attr("stroke-width", 0).attr("font-family", "Almendra SC").attr("font-size", 18).attr("data-size", 18).attr("filter", null);
|
||||||
|
|
||||||
const example = group.append("text").attr("x", 0).attr("x", 0).text(name);
|
const example = group.append("text").attr("x", 0).attr("x", 0).text(name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue