Merge pull request #514 from LiPinghai/master

修复placement判断错误
This commit is contained in:
liaoxuezhi 2020-03-30 15:19:39 +08:00 committed by GitHub
commit 04c8d5954d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,7 +257,7 @@ export function calculatePosition(
positionLeft += leftDelta; positionLeft += leftDelta;
arrowOffsetLeft = 50 * (1 - (2 * leftDelta) / overlayHeight) + '%'; arrowOffsetLeft = 50 * (1 - (2 * leftDelta) / overlayHeight) + '%';
} else if ((placement = 'center')) { } else if ((placement === 'center')) {
// atX = atY = myX = myY = 'center'; // atX = atY = myX = myY = 'center';
positionLeft = childOffset.left + (childOffset.width - overlayWidth) / 2; positionLeft = childOffset.left + (childOffset.width - overlayWidth) / 2;
positionTop = childOffset.top + (childOffset.height - overlayHeight) / 2; positionTop = childOffset.top + (childOffset.height - overlayHeight) / 2;