Compare commits
2 Commits
79ce616781
...
c6c984c34c
| Author | SHA1 | Date | |
|---|---|---|---|
| c6c984c34c | |||
| c84fb50087 |
@@ -212,7 +212,7 @@ export function CouplePage(p: {
|
||||
shouldAllowLeaving?: boolean;
|
||||
children?: Member[];
|
||||
onCancel?: () => void;
|
||||
onSave?: (m: Couple) => void;
|
||||
onSave?: (m: Couple) => Promise<void>;
|
||||
onRequestEdit?: () => void;
|
||||
onRequestDelete?: () => void;
|
||||
onForceReload?: () => void;
|
||||
|
||||
@@ -234,7 +234,7 @@ export function MemberPage(p: {
|
||||
siblings?: Member[];
|
||||
couples?: Couple[];
|
||||
onCancel?: () => void;
|
||||
onSave?: (m: Member) => void;
|
||||
onSave?: (m: Member) => Promise<void>;
|
||||
onRequestEdit?: () => void;
|
||||
onRequestDelete?: () => void;
|
||||
onForceReload?: () => void;
|
||||
|
||||
@@ -254,6 +254,7 @@ function NodeArea(p: {
|
||||
let pers2 = p.node.spouse?.member;
|
||||
let didSwap = false;
|
||||
|
||||
// Show male of the left (all the time)
|
||||
if (pers2?.sex === "M") {
|
||||
let s = pers1;
|
||||
pers1 = pers2;
|
||||
@@ -293,10 +294,37 @@ function NodeArea(p: {
|
||||
let childrenLinkX: number;
|
||||
let childrenLinkY: number;
|
||||
|
||||
if (p.node.spouse) {
|
||||
// If the father is the father of all the children, while the
|
||||
// mother is not the mother of any of the children
|
||||
if (
|
||||
pers2 &&
|
||||
p.node.down.every(
|
||||
(n) => n.member.father === pers1.id && n.member.mother !== pers2!.id
|
||||
)
|
||||
) {
|
||||
childrenLinkX = parent_x_offset + Math.floor(memberCardWidth(pers1) / 2);
|
||||
childrenLinkY = p.y + CARD_HEIGHT + 2;
|
||||
}
|
||||
// If the mother is the mother of all the children, while the
|
||||
// father is not the father of any of the children
|
||||
if (
|
||||
pers2 &&
|
||||
p.node.down.every(
|
||||
(n) => n.member.father !== pers1.id && n.member.mother === pers2!.id
|
||||
)
|
||||
) {
|
||||
childrenLinkX = beginSecondFaceX! + Math.floor(memberCardWidth(pers2) / 2);
|
||||
childrenLinkY = p.y + CARD_HEIGHT + 2;
|
||||
}
|
||||
|
||||
// Normal couple
|
||||
else if (p.node.spouse) {
|
||||
childrenLinkX = Math.floor((endFirstFaceX + beginSecondFaceX!) / 2);
|
||||
childrenLinkY = middleParentFaceY;
|
||||
} else {
|
||||
}
|
||||
|
||||
// Single person
|
||||
else {
|
||||
childrenLinkX = parent_x_offset + Math.floor(memberCardWidth(pers1) / 2);
|
||||
childrenLinkY = p.y + CARD_HEIGHT + 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user