UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

26 lines • 1.21 kB
/** * Geometry shared by the booth label drawers for holding label text clear of * the booth border. */ /** Margin held around a booth label, as a share of each rect dimension. */ export declare const LABEL_MARGIN_FRACTION = 0.05; /** * How far a label box is pulled in from the booth footprint to clear the drawn * border — half the stroke, since the border straddles the footprint edge. * * Capped at the margin and floored at zero: a plan can publish a * `boothBorderWidth` far larger than the strokes it actually draws, and an * uncapped inset then deflates the label box to nothing, so no font size fits * and the label never renders at all. NaN and negative widths reach here too — * an unparsable `stroke-width`, or the empty-booths `0 / 0` in * `boothStore.borderWidth` — and fall out to zero rather than poisoning the box. * * @param borderWidth - stroke width actually painted for the booth * @param size - the booth footprint * @returns a non-negative inset, at most `LABEL_MARGIN_FRACTION` of the short side */ export declare function getLabelBorderInset(borderWidth: number, size: { width: number; height: number; }): number; //# sourceMappingURL=label-inset.d.ts.map