fix: Properties x and y of BoundingRect is undefined in old browser (#2797)

This commit is contained in:
MoyuScript 2022-01-23 00:18:49 +08:00 committed by GitHub
parent 67c5e8dec4
commit e587a82dca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,8 @@ export class Bounds {
const domRect = Array.from(domRectList).find((rect) => rect.width !== 0);
return domRect
? new Bounds(
domRect.x + context.windowBounds.left,
domRect.y + context.windowBounds.top,
domRect.left + context.windowBounds.left,
domRect.top + context.windowBounds.top,
domRect.width,
domRect.height
)