This commit is contained in:
xudan 2025-06-11 10:53:44 +08:00
commit 9e551eee46

View File

@ -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 });