MCPcopy
hub / github.com/midrender/revideo / reparent

Method reparent

packages/2d/src/lib/components/Node.ts:971–979  ·  view source on GitHub ↗

* Change the parent of this node while keeping the absolute transform. * * @remarks * After performing this operation, the node will stay in the same place * visually, but its parent will be changed. * * @param newParent - The new parent of this node.

(newParent: Node)

Source from the content-addressed store, hash-verified

969 * @param newParent - The new parent of this node.
970 */
971 public reparent(newParent: Node) {
972 const position = this.absolutePosition();
973 const rotation = this.absoluteRotation();
974 const scale = this.absoluteScale();
975 newParent.add(this);
976 this.absolutePosition(position);
977 this.absoluteRotation(rotation);
978 this.absoluteScale(scale);
979 }
980
981 /**
982 * Remove all children of this node.

Callers

nothing calls this directly

Calls 1

addMethod · 0.65

Tested by

no test coverage detected