Add logic to detect and filter spline corridor junctions related to selected paths

This commit is contained in:
2026-05-13 13:26:48 +02:00
parent aa78f83cac
commit 15f353791b

View File

@@ -2818,6 +2818,29 @@ export function App({
terrainList
);
const selectedPath = getSelectedPath(editorState.selection, pathList);
const splineCorridorJunctionList = getSplineCorridorJunctions(
editorState.document.splineCorridorJunctions
);
const splineCorridorJunctionCandidates = detectSplineCorridorJunctionCandidates({
paths: pathList,
junctions: editorState.document.splineCorridorJunctions,
terrains: terrainList.filter((terrain) => terrain.enabled)
});
const selectedPathJunctionCandidates =
selectedPath === null
? []
: splineCorridorJunctionCandidates.filter((candidate) =>
candidate.connections.some(
(connection) => connection.pathId === selectedPath.id
)
);
const selectedPathJunctions =
selectedPath === null
? []
: getSplineCorridorJunctionsConnectedToPath({
junctions: editorState.document.splineCorridorJunctions,
pathId: selectedPath.id
});
const selectedPathPointState = getSelectedPathPointState(
editorState.selection,
selectedPath