diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts index 9c3fc8e..e2ca562 100644 --- a/src/services/editor.service.ts +++ b/src/services/editor.service.ts @@ -406,7 +406,9 @@ export class EditorService extends Meta2d { const x = cx - 37; const y = cy - 37; const rotate = angle ?? or; - const path = points?.map((p) => [p.x - cx, p.y - cy]) ?? robot.path?.map((d) => [d.x + ox! - x, d.y + oy! - y]); + const path = + points?.map((p) => ({ x: p.x - cx, y: p.y - cy })) ?? + robot.path?.map((p) => ({ x: p.x + ox! - x, y: p.y + oy! - y })); const o = { ...robot, ...omitBy({ active, path }, isNil) }; if (isNil(active)) { this.setValue({ id, x, y, rotate, robot: o, visible: true }, { render: true, history: false, doEvent: false });