weasel API - v0.8.0
    Preparing search index...

    Function worldEditToStorage

    • Inverse of pathInWorld for an editable polygon: given a polygon edited in world space and the node's current pose, produce the unrotated stored path plus an updated pose. Inverse-rotates about the pose's AABB center (so the stored path stays unrotated and the pose's rotation is preserved), then realigns the result to its own AABB origin and updates the pose's AABB fields. The invariant pathInWorld(result.path, result.pose) === worldPath holds (up to the AABB-center pivot), so anchor edits round-trip.

      Generic in the pose type so consumer-defined pose fields (including rotation) survive the round-trip. Used by both the edit-commit seam and the live anchor-drag preview so they share one world→local inversion.

      Type Parameters

      Parameters

      Returns { path: PolygonPath; pose: P }