Update viewport-host to handle active transform session

This commit is contained in:
2026-04-13 22:32:40 +02:00
parent 05d8f75cb4
commit f5ce536759

View File

@@ -3278,15 +3278,18 @@ export class ViewportHost {
} }
break; break;
case "pathPoint": { case "pathPoint": {
const activeTransformSession = this.currentTransformSession;
if ( if (
this.currentTransformSession.preview.kind !== "pathPoint" || activeTransformSession.kind !== "active" ||
activeTransformSession.preview.kind !== "pathPoint" ||
this.currentDocument === null this.currentDocument === null
) { ) {
break; break;
} }
const currentPath = const currentPath =
this.currentDocument.paths[this.currentTransformSession.target.pathId]; this.currentDocument.paths[activeTransformSession.target.pathId];
if (currentPath === undefined) { if (currentPath === undefined) {
break; break;
@@ -3296,10 +3299,10 @@ export class ViewportHost {
{ {
...currentPath, ...currentPath,
points: currentPath.points.map((point) => points: currentPath.points.map((point) =>
point.id === this.currentTransformSession.target.pointId point.id === activeTransformSession.target.pointId
? { ? {
...point, ...point,
position: this.currentTransformSession.preview.position position: activeTransformSession.preview.position
} }
: point : point
) )