mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
State labels: new label placing algorithm (#977)
* feat: draw state labels start * feat: update old .map files * chore: update version hash * fear: add change to the user's changelog
This commit is contained in:
parent
1bb90251cd
commit
87599d1530
15 changed files with 395 additions and 281 deletions
|
|
@ -698,4 +698,11 @@ export function resolveVersionConflicts(version) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (version < 1.92) {
|
||||
// v1.92 change labels text-anchor from 'start' to 'middle'
|
||||
labels.selectAll("tspan").each(function () {
|
||||
this.setAttribute("x", 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ function editStateName(state) {
|
|||
s.name = nameInput.value;
|
||||
s.formName = formSelect.value;
|
||||
s.fullName = fullNameInput.value;
|
||||
if (changed && stateNameEditorUpdateLabel.checked) BurgsAndStates.drawStateLabels([s.i]);
|
||||
if (changed && stateNameEditorUpdateLabel.checked) drawStateLabels([s.i]);
|
||||
refreshStatesEditor();
|
||||
}
|
||||
}
|
||||
|
|
@ -877,7 +877,7 @@ function recalculateStates(must) {
|
|||
if (!layerIsOn("toggleBorders")) toggleBorders();
|
||||
else drawBorders();
|
||||
if (layerIsOn("toggleProvinces")) drawProvinces();
|
||||
if (adjustLabels.checked) BurgsAndStates.drawStateLabels();
|
||||
if (adjustLabels.checked) drawStateLabels();
|
||||
refreshStatesEditor();
|
||||
}
|
||||
|
||||
|
|
@ -1022,7 +1022,7 @@ function applyStatesManualAssignent() {
|
|||
if (affectedStates.length) {
|
||||
refreshStatesEditor();
|
||||
layerIsOn("toggleStates") ? drawStates() : toggleStates();
|
||||
if (adjustLabels.checked) BurgsAndStates.drawStateLabels([...new Set(affectedStates)]);
|
||||
if (adjustLabels.checked) drawStateLabels([...new Set(affectedStates)]);
|
||||
adjustProvinces([...new Set(affectedProvinces)]);
|
||||
layerIsOn("toggleBorders") ? drawBorders() : toggleBorders();
|
||||
if (layerIsOn("toggleProvinces")) drawProvinces();
|
||||
|
|
@ -1459,7 +1459,7 @@ function openStateMergeDialog() {
|
|||
layerIsOn("toggleStates") ? drawStates() : toggleStates();
|
||||
layerIsOn("toggleBorders") ? drawBorders() : toggleBorders();
|
||||
layerIsOn("toggleProvinces") && drawProvinces();
|
||||
BurgsAndStates.drawStateLabels([rulingStateId]);
|
||||
drawStateLabels([rulingStateId]);
|
||||
|
||||
refreshStatesEditor();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue