(name: string)
| 6 | /** The padding plus border of a laid-out label on its thinner side, per axis. */ |
| 7 | export function labelEdges(style: Pick<CSSStyleDeclaration, 'getPropertyValue'>): [number, number] { |
| 8 | const side = (name: string) => (parseFloat(style.getPropertyValue(`padding-${name}`)) || 0) |
| 9 | + (parseFloat(style.getPropertyValue(`border-${name}-width`)) || 0); |
| 10 | return [Math.min(side('left'), side('right')), Math.min(side('top'), side('bottom'))]; |
| 11 | } |
| 12 |