From e23618806b6beeb635a58d7cf39a47757de38a99 Mon Sep 17 00:00:00 2001 From: IliesAllali Date: Mon, 19 Oct 2026 22:59:31 +0200 Subject: [PATCH] =?UTF-8?q?placement=20:=20le=20c=C3=B4t=C3=A9=20des=20bel?= =?UTF-8?q?les-familles=20se=20d=C3=A9cide=20par=20le=20centre=20de=20la?= =?UTF-8?q?=20famille=20dessin=C3=A9e,=20plus=20par=20la=20r=C3=A9f=C3=A9r?= =?UTF-8?q?ence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Au bord (dernière génération, charnière d'un onglet), la référence envoyait toutes les belles-familles du même côté. Onglet Lecarpentier : croisements 3 → 1, fratries coupées 2 → 1. Co-Authored-By: Claude Fable 5.1 --- frontend/src/components/galaxy/blockLayout.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/galaxy/blockLayout.js b/frontend/src/components/galaxy/blockLayout.js index c2e73bf..892a6a0 100644 --- a/frontend/src/components/galaxy/blockLayout.js +++ b/frontend/src/components/galaxy/blockLayout.js @@ -100,9 +100,10 @@ export function computeBlockLayout(graphData = null, referenceId = null, { famil // ne change, ou après quatre passes (les positions bougent d'une passe à l'autre) for (let pass = 0; pass < 4 && result._inlaws?.length; pass++) { const byId = new Map(result.children.map(n => [n.id, n])) - const ref = referenceId != null ? byId.get(`p-${referenceId}`) : null const persons = result.children.filter(n => n._type === 'person') - const pivot = ref ? ref.x + ref.width / 2 : persons.length ? (Math.min(...persons.map(n => n.x)) + Math.max(...persons.map(n => n.x + n.width))) / 2 : 0 + // Pivot : le centre de la famille dessinée. La référence elle-même, souvent au bord (dernière génération, + // charnière d'un onglet), enverrait toutes les belles-familles du même côté (Patch, 19/10 : « moins clair ») + const pivot = persons.length ? (Math.min(...persons.map(n => n.x)) + Math.max(...persons.map(n => n.x + n.width))) / 2 : 0 let changed = false for (const { anchorId, side } of result._inlaws) { const a = byId.get(anchorId)