1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[Editor] Make sure everything is cleaned up when we switch to annotation editor mode

This commit is contained in:
Calixte Denizet 2024-07-02 15:49:54 +02:00
parent bdcc4a0feb
commit 68175323f1
2 changed files with 16 additions and 14 deletions

View file

@ -135,6 +135,7 @@ function getSelector(id) {
async function getRect(page, selector) {
// In Chrome something is wrong when serializing a `DomRect`,
// so we extract the values and return them ourselves.
await page.waitForSelector(selector);
return page.$eval(selector, el => {
const { x, y, width, height } = el.getBoundingClientRect();
return { x, y, width, height };