HTMLElement.prototype.getBoundingClientRectBak = HTMLElement.prototype.getBoundingClientRect;
HTMLElement.prototype.getBoundingClientRect = function (){
const rect = HTMLElement.prototype.getBoundingClientRectBak.call(this)
if (this === document.documentElement){
return rect
}
var zoom = document.documentElement.clientWidth/2048 || window.getComputedStyle(document.body).zoom //设置的zoom
var scrollTop = rect.top;
var scrollLeft = rect.left;
var offsetScrollTop=scrollTop -(scrollTop /zoom);
var offsetScrollLeft = scrollLeft -(scrollLeft / zoom);
return new DOMRect(rect.x - offsetScrollLeft, rect.y - offsetScrollTop, rect.width,rect.height);
}

11-11
1635
1635

被折叠的 条评论
为什么被折叠?



