From d0bbc9741df73e0b2d555095537d0791fbe58d2f Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 13 Apr 2026 22:27:40 +0200 Subject: [PATCH] Update getSelectedPath to use getSingleSelectedPathOwnerId and add getSelectedPathPointState function --- src/app/App.tsx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/app/App.tsx b/src/app/App.tsx index 2bccf84c..4d6602aa 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -902,7 +902,7 @@ function getSelectedPath( selection: EditorSelection, paths: ScenePath[] ): ScenePath | null { - const selectedPathId = getSingleSelectedPathId(selection); + const selectedPathId = getSingleSelectedPathOwnerId(selection); if (selectedPathId === null) { return null; @@ -911,6 +911,28 @@ function getSelectedPath( return paths.find((path) => path.id === selectedPathId) ?? null; } +function getSelectedPathPointState( + selection: EditorSelection, + path: ScenePath | null +): { point: ScenePathPoint; index: number } | null { + const selectedPathPoint = getSingleSelectedPathPoint(selection); + + if (selectedPathPoint === null || path === null || selectedPathPoint.pathId !== path.id) { + return null; + } + + const pointIndex = getScenePathPointIndex(path, selectedPathPoint.pointId); + + if (pointIndex === -1) { + return null; + } + + return { + point: path.points[pointIndex], + index: pointIndex + }; +} + function isModelAsset(asset: ProjectAssetRecord): asset is ModelAssetRecord { return asset.kind === "model"; }