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:
co-authored by
Claude Opus 5.5
parent
eeb2a9a066
commit
b36a4b63a3
+3
-2
@@ -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 || [])];
|
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
|
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) });
|
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;
|
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;
|
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
|
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);
|
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)) });
|
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 };
|
return { anim, maj, cliquables, points, lumieres, haieOuverte, laisses, maisonsObjets, retouches: mesureRetouches };
|
||||||
|
|||||||
+3
-1
@@ -56,7 +56,9 @@ export function comparerReleves(a: any, b: any, cm = 0.01, deg = 0.1): Ecart[] {
|
|||||||
for (const o of a[cle] || []) un(o, B.get(o.id ?? o.i), `${cle} ${o.id ?? o.i}`);
|
for (const o of a[cle] || []) un(o, B.get(o.id ?? o.i), `${cle} ${o.id ?? o.i}`);
|
||||||
if ((b[cle] || []).length !== (a[cle] || []).length) e.push(`${cle} : ${(a[cle] || []).length} avant, ${(b[cle] || []).length} après`);
|
if ((b[cle] || []).length !== (a[cle] || []).length) e.push(`${cle} : ${(a[cle] || []).length} avant, ${(b[cle] || []).length} après`);
|
||||||
}
|
}
|
||||||
const ordreA = (a.poses || []).map((o: any) => o.id).join(','), ordreB = (b.poses || []).map((o: any) => o.id).join(',');
|
// l'ordre d'ajout des objets communs (une ligne ajoutée en bas de la table ajoute un objet à la fin, sans changer l'ordre)
|
||||||
|
const idsB = new Set((b.poses || []).map((o: any) => o.id)), idsA = new Set((a.poses || []).map((o: any) => o.id));
|
||||||
|
const ordreA = (a.poses || []).map((o: any) => o.id).filter((i: string) => idsB.has(i)).join(','), ordreB = (b.poses || []).map((o: any) => o.id).filter((i: string) => idsA.has(i)).join(',');
|
||||||
if (ordreA !== ordreB) e.push('poses : l\'ordre d\'ajout a changé');
|
if (ordreA !== ordreB) e.push('poses : l\'ordre d\'ajout a changé');
|
||||||
for (const k of new Set([...Object.keys(a.points || {}), ...Object.keys(b.points || {})])) {
|
for (const k of new Set([...Object.keys(a.points || {}), ...Object.keys(b.points || {})])) {
|
||||||
const p = a.points[k], q = b.points?.[k];
|
const p = a.points[k], q = b.points?.[k];
|
||||||
|
|||||||
Reference in New Issue
Block a user