Skip to content

Commit

Permalink
Fix saving, smooth rotating.
Browse files Browse the repository at this point in the history
  • Loading branch information
twastvedt committed Jan 23, 2024
1 parent 799cbae commit 033f7a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ npm run lint

## To Do

1. Marriages get wider at edge??
1. type="about" dateVal - estimate? Other types?
1. Fix the center (see poster for ideas).
1. Use parsed event dates to place nodes
3 changes: 1 addition & 2 deletions src/components/PersonNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ onMounted(() => {
:class="['node', 'person', person.gender]"
:id="person.handle"
:transform="`rotate(${person.angle - 90})`"
ref="rotateTarget"
>
<linearGradient
v-if="lifelineGradient"
Expand Down Expand Up @@ -340,7 +341,6 @@ onMounted(() => {

<line
class="pointerTarget rotate"
ref="rotateTarget"
x1="0"
x2="0"
:y1="scale(mainPathStart)"
Expand All @@ -351,7 +351,6 @@ onMounted(() => {
{{ title }}
</title>
</line>
/>

<line
v-if="person.birth.isEstimate"
Expand Down
15 changes: 11 additions & 4 deletions src/models/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,12 @@ export class Data {
console.log('families left: ', this.familiesToDo.size);
}

// Set overrides
// Set date overrides
for (const [handle, override] of Object.entries(
this.settings.value.overrides.people,
)) {
const person = this.tree.people[handle];
if (person) {
if (override.angle != undefined) {
person.angle = override.angle;
}
if (override.birth != undefined) {
person.birth = {
date: new Date(override.birth, 0, 1),
Expand Down Expand Up @@ -264,6 +261,16 @@ export class Data {
(familyAngle / (family.children.length + 1)) * (i + 1);
});
});

// Set angle overrides
for (const [handle, override] of Object.entries(
this.settings.value.overrides.people,
)) {
const person = this.tree.people[handle];
if (person && override.angle != undefined) {
person.angle = override.angle;
}
}
}

//Add sorting info to a parent and the tree
Expand Down

0 comments on commit 033f7a4

Please sign in to comment.