mirror of https://github.com/gorhill/uBlock.git
this fixes #210
This commit is contained in:
parent
75c24a4368
commit
67495378cf
|
@ -280,8 +280,11 @@ var highlightElements = function(elems, force) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
targetElements = elems;
|
targetElements = elems;
|
||||||
var offx = window.pageXOffset;
|
|
||||||
var offy = window.pageYOffset;
|
// https://github.com/gorhill/uBlock/issues/210
|
||||||
|
var bodyRect = document.body.getBoundingClientRect();
|
||||||
|
var offx = bodyRect.left;
|
||||||
|
var offy = bodyRect.top;
|
||||||
var ow = svgRoot.getAttribute('width');
|
var ow = svgRoot.getAttribute('width');
|
||||||
var ocean = [
|
var ocean = [
|
||||||
'M0 0',
|
'M0 0',
|
||||||
|
@ -299,14 +302,14 @@ var highlightElements = function(elems, force) {
|
||||||
}
|
}
|
||||||
r = elem.getBoundingClientRect();
|
r = elem.getBoundingClientRect();
|
||||||
ocean.push(
|
ocean.push(
|
||||||
'M', r.left + offx, ' ', r.top + offy,
|
'M', r.left - offx, ' ', r.top - offy,
|
||||||
'h', r.width,
|
'h', r.width,
|
||||||
'v', r.height,
|
'v', r.height,
|
||||||
'h-', r.width,
|
'h-', r.width,
|
||||||
'z'
|
'z'
|
||||||
);
|
);
|
||||||
islands.push(
|
islands.push(
|
||||||
'M', r.left + offx, ' ', r.top + offy,
|
'M', r.left - offx, ' ', r.top - offy,
|
||||||
'h', r.width,
|
'h', r.width,
|
||||||
'v', r.height,
|
'v', r.height,
|
||||||
'h-', r.width,
|
'h-', r.width,
|
||||||
|
|
Loading…
Reference in New Issue