fix DOMRect for vertical position calculation (#1986)

This commit is contained in:
Shadowlauch 2021-10-15 01:29:52 +02:00 committed by GitHub
parent 0a8992d215
commit b3d38fce47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -560,16 +560,16 @@ class Popup extends EventDispatcher {
const verticalOffset = optionsGeneral.popupVerticalOffset2 * offsetScale;
const [x, w] = this._getConstrainedPositionBinary(
elementRect.left - horizontalOffset,
elementRect.right + horizontalOffset,
elementRect.x - horizontalOffset,
elementRect.x + elementRect.width + horizontalOffset,
width,
viewport.left,
viewport.right,
preferRight
);
const [y, h, below] = this._getConstrainedPosition(
elementRect.bottom - verticalOffset,
elementRect.top + verticalOffset,
elementRect.y + elementRect.height - verticalOffset,
elementRect.y + verticalOffset,
height,
viewport.top,
viewport.bottom,