resizeBoundsForElement

fun resizeBoundsForElement(element: Element, handle: ResizeHandle, pointer: Offset): Rect

Type-aware variant of resizeBounds. The returned bounds is sized so that element.withBounds(returnedBounds).bounds() == returnedBounds — i.e., no second-pass snapping inside withBounds can shift the result.

For circles, the result is constrained to a square anchored at the un-dragged corner / edge midpoint in local space. The rotation shift is then applied to keep that anchor's WORLD position fixed.