[K4] Leistung: id-Suche indiziert (Kern-Index, Treffer-Positionen für applyOps), Commit ohne Kopie (Verlauf nur inverse Ops), Dach-Firsthöhe nach Inhalt gemerkt, Polylinien-Punkttyp im Kern

Objekt-Info und Griffe suchen über den Positions-Index des Dokuments (Lookup), TS-applyOps
übernimmt die vom Kern getroffenen Positionen (doc_last_hits). Commit verschiebt die Ops ins
Dokument; Redo entsteht beim Rückgängigmachen als Inverse der Inversen. setPolylineVertexType
rechnet polyline_vertex.rs (bitgleich, 143 880 Fälle), TS-withVertexType gelöscht.
This commit is contained in:
Claude committed 2026-10-29 12:42:43 +00:00
1 parent 30f573e43d
commit 24ab554c2e
22 files changed
+1168 -538

No files matched your search

+4 -2
View File
@@ -9,7 +9,7 @@
// {@link opsMutation} die Ops mit — `setProject` nimmt dann die Ops ohne Differenz.
import type { Project } from "../model/types";
import { applyOps } from "./ops";
import { applyOps, indexOfId } from "./ops";
import type { CoreOp } from "./ops";
/** Projekt-Felder, die Listen von Elementen mit `id` sind (walls, drawings2d, rooms, …). */
@@ -34,7 +34,9 @@ export function itemsOf<K extends EntityCollection>(p: Project, collection: K):
/** Element `id` aus `collection` (erstes Vorkommen). */
export function findItem<K extends EntityCollection>(p: Project, collection: K, id: string): EntityOf<K> | undefined {
return itemsOf(p, collection).find((e) => (e as { id: string }).id === id);
const list = itemsOf(p, collection);
const i = indexOfId(list, id);
return i < 0 ? undefined : list[i];
}
/** Ersetzt ein Element (gleiche id, Position bleibt). */