Skip to main content

border_inner_shape

Function border_inner_shape 

Source
pub fn border_inner_shape(
    rect: Rect,
    radius: BorderRadius,
    widths: [f32; 4],
) -> Option<(Rect, BorderRadius)>
Expand description

The inner edge of a border: the box pulled in by each side’s thickness, with the corners tightened to match.

Shared rather than derived twice, because the rasterizer and the GPU have to agree to the pixel on where a border stops — one builds a path from it and the other an SDF, and a rule under a header that lands a half pixel apart between backends is a bug nobody can see until they switch machines.

None when the border leaves no interior at all: the box is thinner than its own frame, and the frame swallows it whole.