mirror of
https://github.com/xodio/xod.git
synced 2026-03-15 21:26:51 +01:00
11 lines
340 B
JavaScript
11 lines
340 B
JavaScript
export default function getBoundingClientRect(page, elementHandle) {
|
|
return page.evaluate(
|
|
(el) => {
|
|
// otherwise we'll get an empty object
|
|
const { bottom, height, left, right, top, width, x, y } = el.getBoundingClientRect();
|
|
return { bottom, height, left, right, top, width, x, y };
|
|
},
|
|
elementHandle
|
|
);
|
|
}
|