[182] [149] Grundriss-Knopf nur im Grundriss-Reiter hervorgehoben, toter Auto-Schnitt im 3D entfernt; TODO [149] auf Stand (Auswahlrechteck/Beschriftung waren schon gebaut)

This commit is contained in:
Claude committed 2026-11-11 01:55:29 +00:00
1 parent 1419679963
commit ec77d07300
7 files changed
+25 -16

No files matched your search

+3 -11
View File
@@ -4,8 +4,8 @@
// Zeichnungsebenen aus dem Store ([121]); die Objekt-Info der Auswahl rechnen Panels selbst
// (`useSelectionInfo`), der Panel-Host beim Aufruf eines Handlers.
import { useCallback, useEffect, useMemo } from "react";
import type { DrawingLevel, ViewType } from "../model/types";
import { useCallback, useMemo } from "react";
import type { DrawingLevel } from "../model/types";
import { sectionPlaneFromLevel } from "../core";
import { useStore } from "./appStore";
import type { useSelectionState } from "./useSelectionState";
@@ -14,12 +14,11 @@ type Sel = ReturnType<typeof useSelectionState>;
export function useSectionLineState(opts: {
activeLevel: DrawingLevel;
viewType: ViewType;
selectedSectionLineId: string | null;
section3dCutId: Sel["section3dCutId"];
setSection3dCutId: Sel["setSection3dCutId"];
}) {
const { activeLevel, viewType, selectedSectionLineId, section3dCutId, setSection3dCutId } = opts;
const { activeLevel, selectedSectionLineId, section3dCutId, setSection3dCutId } = opts;
const drawingLevels = useStore((s) => s.project.drawingLevels);
// Gewählte Schnitt-/Ansichtslinie (DrawingLevel) — separat von `selection`, da
@@ -56,13 +55,6 @@ export function useSectionLineState(opts: {
return lvl ? sectionPlaneFromLevel(lvl) : null;
}, [drawingLevels, section3dCutId]);
// Aus einem Schnitt ins 3D ([115]): der Live-Schnitt folgt der Schnittlinie dieses Schnitts (einmal
// beim Wechsel; im 3D lässt er sich wie sonst aufheben).
const sectionLevelIn3d = activeLevel.kind === "section" && viewType === "perspektive" ? activeLevel.id : null;
useEffect(() => {
if (sectionLevelIn3d) setSection3dCutId(sectionLevelIn3d);
}, [sectionLevelIn3d, setSection3dCutId]);
// Bindet den 3D-Live-Schnitt an eine Schnittlinie (Toggle im Objekt-Info).
const onToggleSection3dCut = useCallback(
(id: string) => setSection3dCutId((cur) => (cur === id ? null : id)),