MCPcopy
hub / github.com/microsoft/SandDance / outerSize

Function outerSize

packages/vega-deck.gl/src/htmlHelpers.ts:33–38  ·  view source on GitHub ↗
(el: HTMLElement)

Source from the content-addressed store, hash-verified

31 * @param el HTML Element to measure.
32 */
33export function outerSize(el: HTMLElement) {
34 const cs = getComputedStyle(el);
35 const height = parseFloat(cs.marginTop) + parseFloat(cs.paddingTop) + parseFloat(cs.borderTopWidth) + el.offsetHeight + parseFloat(cs.borderBottomWidth) + parseFloat(cs.paddingBottom) + parseFloat(cs.marginBottom);
36 const width = parseFloat(cs.marginLeft) + parseFloat(cs.paddingLeft) + parseFloat(cs.borderLeftWidth) + el.offsetWidth + parseFloat(cs.borderRightWidth) + parseFloat(cs.paddingRight) + parseFloat(cs.marginRight);
37 return { height, width };
38}

Callers 1

constructorMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected