Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twastvedt committed Jan 28, 2024
1 parent 033f7a4 commit d166ad8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function loadSettings() {
style="display: none"
/>
<button @click="() => xmlInput?.click()">Load Gramps xml</button>
<button @click="settingsStore.reset">Reset Settings</button>
<button @click="() => settingsStore.reset()">Reset Settings</button>
<button @click="exportSettings">Export Settings</button>
<input
type="file"
Expand Down
13 changes: 7 additions & 6 deletions src/components/FamilyNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ const startAngle = computed(() => {
if (minParent <= start) {
start = minParent;
} else {
// TODO: setting
start -= 5;
start -=
(settings.value.layout.unknownMarriageExtension * 180) /
(radius.value * Math.PI);
}
return start;
Expand All @@ -55,16 +56,16 @@ const endAngle = computed(() => {
if (maxParent >= end) {
end = maxParent;
} else {
end += 5;
end +=
(settings.value.layout.unknownMarriageExtension * 180) /
(radius.value * Math.PI);
}
return end;
}
});
const centerAngle = computed(
() => startAngle.value + (endAngle.value - startAngle.value) / 2,
);
const centerAngle = computed(() => (startAngle.value + endAngle.value) / 2);
const reversed = computed(() => centerAngle.value % 360 <= 180);
const radius = computed(() => scale(family.value.marriage.date));
Expand Down
3 changes: 2 additions & 1 deletion src/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"textSize": 12,
"maxYear": 2020,
"minFamilyWidth": 80,
"fadeYears": 15
"fadeYears": 15,
"unknownMarriageExtension": 10
},
"dateLabels": [90, 270],
"colors": {
Expand Down
4 changes: 4 additions & 0 deletions src/stores/settingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export interface Settings {
* Size of lifeline gradient, in years, when date of death is uncertain.
*/
fadeYears: number;
/**
* Length of tail on marriage line when one partner is unknown.
*/
unknownMarriageExtension: number;
};
/**
* Angle of each line of date labels.
Expand Down

0 comments on commit d166ad8

Please sign in to comment.