|
|
|
@ -41,6 +41,7 @@ export function getElementVisibleRect( |
|
|
|
const left = Math.max(rect.left, 0); |
|
|
|
const right = Math.min(rect.right, viewWidth); |
|
|
|
|
|
|
|
// 如果元素完全不可见,则返回一个空的矩形
|
|
|
|
if (top >= viewHeight || bottom <= 0 || left >= viewWidth || right <= 0) { |
|
|
|
return { |
|
|
|
bottom: 0, |
|
|
|
|