(element: HTMLElement)
| 150 | * @returns |
| 151 | */ |
| 152 | export function getElementClientCenter(element: HTMLElement) { |
| 153 | const { left, top, width, height } = element.getBoundingClientRect(); |
| 154 | return { |
| 155 | x: left + width / 2, |
| 156 | y: top + height / 2, |
| 157 | }; |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * Get the data-* attributions from props |
no outgoing calls
no test coverage detected