Conditions | 1 |
Total Lines | 6 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { ElementHandle } from 'puppeteer'; |
||
11 | |||
12 | // Replacement of element.boundingBox() - we need to get node positions within SVG container, not relative to main frame |
||
13 | export async function getElementBBox(element: ElementHandle<SVGGraphicsElement>) { |
||
14 | return await element.evaluate(el => { |
||
15 | const { x, y, width, height } = el.getBBox(); |
||
16 | return { x, y, width, height }; |
||
17 | }); |
||
19 |