From 3e5ea88bbfca3b6991f22817adf62f7498222a33 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 12 May 2026 22:47:18 +0200 Subject: [PATCH] Enhance path editing controls by adding handlers for curve mode and sampled resolution. --- src/app/App.tsx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/app/App.tsx b/src/app/App.tsx index 911e0edf..c5d14af9 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -229,15 +229,19 @@ import { type SceneLoadingScreenSettings } from "../document/scene-document"; import { + MAX_SCENE_PATH_SAMPLED_RESOLUTION, MIN_SCENE_PATH_POINT_COUNT, + MIN_SCENE_PATH_SAMPLED_RESOLUTION, areScenePathsEqual, createAppendedScenePathPoint, createScenePath, getScenePathLabel, getScenePathPointIndex, getScenePaths, + normalizeScenePathSampledResolution, normalizeScenePathName, type ScenePath, + type ScenePathCurveMode, type ScenePathPoint } from "../document/paths"; import { @@ -9599,6 +9603,8 @@ export function App({ visible: selectedPath.visible, enabled: selectedPath.enabled, loop: selectedPath.loop, + curveMode: selectedPath.curveMode, + sampledResolution: selectedPath.sampledResolution, points: selectedPath.points.map((point, index) => ({ id: point.id, position: readVec3Draft( @@ -9636,6 +9642,40 @@ export function App({ } }; + const handlePathCurveModeChange = (curveMode: ScenePathCurveMode) => { + if (selectedPath === null) { + setStatusMessage("Select a path before changing its curve mode."); + return; + } + + const nextPath = createScenePath({ + ...selectedPath, + curveMode + }); + + commitPathChange( + selectedPath, + nextPath, + curveMode === "catmullRom" + ? "Set Path curve mode to Spline." + : "Set Path curve mode to Linear." + ); + }; + + const handlePathSampledResolutionChange = (sampledResolution: number) => { + if (selectedPath === null) { + setStatusMessage("Select a path before changing its spline resolution."); + return; + } + + const nextPath = createScenePath({ + ...selectedPath, + sampledResolution: normalizeScenePathSampledResolution(sampledResolution) + }); + + commitPathChange(selectedPath, nextPath, "Updated Path spline resolution."); + }; + const handlePathPointDraftChange = ( pointIndex: number, axis: keyof Vec3Draft,