Handle pathPoint kind in ViewportHost

This commit is contained in:
2026-04-13 22:27:07 +02:00
parent 06b5892dd0
commit a434ff0243

View File

@@ -2232,6 +2232,8 @@ export class ViewportHost {
? session.target.initialCenter
: session.target.kind === "modelInstance"
? session.target.initialPosition
: session.target.kind === "pathPoint"
? session.target.initialPosition
: session.target.initialPosition;
let nextPosition = {
...initialPosition
@@ -2346,6 +2348,13 @@ export class ViewportHost {
};
}
if (session.target.kind === "pathPoint") {
return {
kind: "pathPoint" as const,
position: nextPosition
};
}
return {
kind: "entity" as const,
position: nextPosition,
@@ -3268,6 +3277,36 @@ export class ViewportHost {
});
}
break;
case "pathPoint": {
if (
this.currentTransformSession.preview.kind !== "pathPoint" ||
this.currentDocument === null
) {
break;
}
const currentPath =
this.currentDocument.paths[this.currentTransformSession.target.pathId];
if (currentPath === undefined) {
break;
}
this.updatePathRenderObjectState(
{
...currentPath,
points: currentPath.points.map((point) =>
point.id === this.currentTransformSession.target.pointId
? {
...point,
position: this.currentTransformSession.preview.position
}
: point
)
}
);
break;
}
case "entity": {
if (
this.currentTransformSession.preview.kind !== "entity" ||