Skip to main content

nine_patch_quads

Function nine_patch_quads 

Source
pub fn nine_patch_quads(
    source: Rect,
    destination: Rect,
    insets: NinePatchInsets,
    center: PatchFill,
    edges: PatchFill,
) -> Vec<PatchQuad>
Expand description

The draws that fill destination with source as a nine-patch.

The four corners keep their source size. The four edges grow along one axis and keep their size across it. The middle grows along both. center and edges decide whether the growing parts are stretched or tiled.

Returns a single stretched quad when the insets leave no middle, or when the destination is too small to hold the corners — the picture stays sensible instead of drawing corners on top of each other.