Skip to content
pixi-silk
GitHub repository
Function

gapsBetween

import { gapsBetween } from 'pixi-silk/ui/spacing';
function gapsBetween(rects: readonly SnapRect[], axis: "x" | "y"): GapMarker[];

The gaps between consecutive rectangles along an axis, sorted by position, for rows and columns. Overlapping or touching neighbours have no gap. Use it to show the spacing of an auto-layout container’s children. It does not check that the rectangles share a row.

Parameters#

ParameterType
rectsreadonly SnapRect[]
axis"x" | "y"

Returns#

GapMarker[]