bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Resolve `BorderRect` ambiguity

Open ickshonpe opened this issue 1 month ago • 0 comments

Objective

In UI and world coordinates, “top” and “bottom” mean opposite things, so these fields are ambiguous. Anyone using BorderRect must decide themselves how to apply the vertical insets.

Fixes #21913

For more in detail motivation, see the replies to issue #21913

Solution

Replace the directional BorderRect fields (left, right, top, and bottom) with min_inset and max_inset Vec2 fields.

Using min_inset and max_inset removes the need to interpret top or bottom relative to the coordinate system, so the same logic will work consistently in both UI and 2D.

ickshonpe avatar Nov 23 '25 10:11 ickshonpe