Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit 515f254

Browse files
committed
finally, one that works
1 parent 51bec01 commit 515f254

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

js/element-picker.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -766,11 +766,8 @@ var startPicker = function() {
766766

767767
svgRoot = document.createElementNS(svgns, 'svg');
768768
svgRoot.innerHTML = '<path /><path />';
769-
var nullRect = { left: 0, top: 0, width: 0, height: 0 };
770-
var htmlRect = document.documentElement ? document.documentElement.getBoundingClientRect() : nullRect;
771-
var bodyRect = document.body ? document.body.getBoundingClientRect() : nullRect;
772-
var svgWidth = Math.max(htmlRect.width, bodyRect.width);
773-
var svgHeight = Math.max(htmlRect.height, bodyRect.height);
769+
var svgWidth = document.documentElement.scrollWidth;
770+
var svgHeight = document.documentElement.scrollHeight;
774771
svgRoot.setAttribute('x', 0);
775772
svgRoot.setAttribute('y', 0);
776773
svgRoot.setAttribute('width', svgWidth);

0 commit comments

Comments
 (0)