This commit is contained in:
kuberwastaken 2026-03-31 16:25:52 +05:30
commit ec53fcbe95
1905 changed files with 513762 additions and 0 deletions

23
ink/measure-element.ts Normal file
View file

@ -0,0 +1,23 @@
import type { DOMElement } from './dom.js'
type Output = {
/**
* Element width.
*/
width: number
/**
* Element height.
*/
height: number
}
/**
* Measure the dimensions of a particular `<Box>` element.
*/
const measureElement = (node: DOMElement): Output => ({
width: node.yogaNode?.getComputedWidth() ?? 0,
height: node.yogaNode?.getComputedHeight() ?? 0,
})
export default measureElement