Lot M1 table : une ligne ajoutée en bas (une deuxième ruche) pose un objet de plus sans bouger les autres ; le cadrage d'un objet reste celui de sa première ligne

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jules Nény
2026-11-14 11:51:57 +01:00
co-authored by Claude Opus 5.5
parent eeb2a9a066
commit b36a4b63a3
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -698,7 +698,7 @@ export function objetsNouveaux({ D, groupe, T, P, maisons, tr, PAL, geoP, verre,
const f = ty.fabrique(place_, l), objs = [f.o, ...(f.extra || [])];
if (ty.roule) { // un objet qui roule : il n'occupe aucune place, son cadrage le suit
groupe.add(f.o); const r = roule(f.o, place_.trajet, { v: place_.v, ...ty.roule(place_.trajet, tr) });
maj.push(r.maj); if (l.fiche) relie(objs, l.fiche, l.cadrage.nom); points[l.cadrage.nom] = r.centre; posees[l.id] = { ...place_, objs, centre: r.centre };
maj.push(r.maj); if (l.fiche) relie(objs, l.fiche, l.cadrage.nom); points[l.cadrage.nom] ??= r.centre; posees[l.id] = { ...place_, objs, centre: r.centre };
continue;
}
const { x, z, rot } = place_, a = place_.a ?? l.tailles[0][0] / 2, b = place_.b ?? l.tailles[0][1] / 2, dx = ty.decal || 0;
@@ -710,7 +710,8 @@ export function objetsNouveaux({ D, groupe, T, P, maisons, tr, PAL, geoP, verre,
if (cad && 'avec' in cad) { // le cadrage d'une autre ligne s'élargit pour montrer les deux
const A = posees[cad.avec], nom = lignes.find((k) => k.id === cad.avec).cadrage.nom, d = Math.hypot(x - A.x, z - A.z);
relie(objs, l.fiche, nom, { x: (A.x + x) / 2, z: (A.z + z) / 2, w: Math.min(66, Math.max(A.w, d + 28)) });
} else if (l.fiche) relie(objs, l.fiche, cad.nom, cad.w === null ? undefined : ty.point ? ty.point(place_, cad.w) : { x, z, w: cad.w });
// un cadrage déjà posé par une ligne au-dessus (une deuxième ruche) reste le sien : la fiche montre le premier objet
} else if (l.fiche) relie(objs, l.fiche, cad.nom, cad.w === null || points[cad.nom] ? undefined : ty.point ? ty.point(place_, cad.w) : { x, z, w: cad.w });
}
return { anim, maj, cliquables, points, lumieres, haieOuverte, laisses, maisonsObjets, retouches: mesureRetouches };