Convert worldPose into a local pose expressed under newParentId's
frame. Used when reparenting so the child's visual world position is
preserved despite the change of frame. Inverse of one compose step.
decompose(parent, world) returns the local pose child such that
compose(parent, child) === world. For axis-aligned rects:
child = { ...world, x: world.x - parent.x, y: world.y - parent.y }.
Pass newParentId === null for the root frame; the function returns
worldPose unchanged.
Convert
worldPoseinto a local pose expressed undernewParentId's frame. Used when reparenting so the child's visual world position is preserved despite the change of frame. Inverse of onecomposestep.decompose(parent, world)returns the local posechildsuch thatcompose(parent, child) === world. For axis-aligned rects:child = { ...world, x: world.x - parent.x, y: world.y - parent.y }.Pass
newParentId === nullfor the root frame; the function returnsworldPoseunchanged.