Implement path road change functionality

This commit is contained in:
2026-05-12 23:54:13 +02:00
parent 667d4492ee
commit d2fb7442c4

View File

@@ -9613,6 +9613,7 @@ export function App({
sampledResolution: selectedPath.sampledResolution,
glueToTerrain: selectedPath.glueToTerrain,
terrainOffset: selectedPath.terrainOffset,
road: selectedPath.road,
points: selectedPath.points.map((point, index) => ({
id: point.id,
position: readVec3Draft(
@@ -9718,6 +9719,27 @@ export function App({
commitPathChange(selectedPath, nextPath, "Updated Path terrain offset.");
};
const handlePathRoadChange = (
road: ScenePath["road"],
successMessage: string
) => {
if (selectedPath === null) {
setStatusMessage("Select a path before changing road settings.");
return;
}
try {
const nextPath = createScenePath({
...selectedPath,
road
});
commitPathChange(selectedPath, nextPath, successMessage);
} catch (error) {
setStatusMessage(getErrorMessage(error));
}
};
const handlePathPointDraftChange = (
pointIndex: number,
axis: keyof Vec3Draft,