/** * Shared crop constants for inventory PNG + tape-line overlay (#99). * Aspect is fixed 3:4; crop_fill only moves the long-axis end insets. * Non-retro: changing fill affects future encodes only, not stored PNGs. */ export const DEFAULT_CROP_FILL = 0.9; export const ASPECT_W = 3; export const ASPECT_H = 4; export const FLOOR_PX = 800; /** Fraction of the long axis inset from each end: (1 - fill) / 2. */ export function cropMarginFraction(fill: number = DEFAULT_CROP_FILL): number { const f = clampFill(fill); return (1 - f) / 2; } export function clampFill(fill: number): number { if (!Number.isFinite(fill)) return DEFAULT_CROP_FILL; return Math.min(1, Math.max(0.01, fill)); }