kLegendSwatchBoxSize top-level constant

double const kLegendSwatchBoxSize

On-screen footprint of a legend swatch, in logical pixels.

Both upstream render paths occupy 14: the <svg> viewport is 14 wide (shape.tsx:39-40, :46-49) and the fallback div is 12 of content plus two 1px borders (useLegendsStyles.styles.ts:80-82). Only the synthesised export legend uses kLegendShapeSize instead (image-export-utils.ts:333-336), which is an upstream inconsistency the export path keeps rather than a value to unify.

Implementation

const double kLegendSwatchBoxSize = 12 + 2 * kLegendShapeBorder;