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

    Function scalePathToBounds

    • Scale a path's coords so its current AABB maps to target. Resize interactions use this to make a polygon follow a corner-handle drag.

      Degenerate source axes (width or height == 0) collapse to target.x / target.y — every coord on that axis becomes the new origin. Avoids division by zero without throwing.

      Parameters

      Returns Path