From 515f254a2df7c05542004697e475560614af1d92 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 13 Jul 2014 12:08:36 -0400 Subject: [PATCH] finally, one that works --- js/element-picker.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/js/element-picker.js b/js/element-picker.js index e018ae83c..e3a01eab1 100644 --- a/js/element-picker.js +++ b/js/element-picker.js @@ -766,11 +766,8 @@ var startPicker = function() { svgRoot = document.createElementNS(svgns, 'svg'); svgRoot.innerHTML = ''; - var nullRect = { left: 0, top: 0, width: 0, height: 0 }; - var htmlRect = document.documentElement ? document.documentElement.getBoundingClientRect() : nullRect; - var bodyRect = document.body ? document.body.getBoundingClientRect() : nullRect; - var svgWidth = Math.max(htmlRect.width, bodyRect.width); - var svgHeight = Math.max(htmlRect.height, bodyRect.height); + var svgWidth = document.documentElement.scrollWidth; + var svgHeight = document.documentElement.scrollHeight; svgRoot.setAttribute('x', 0); svgRoot.setAttribute('y', 0); svgRoot.setAttribute('width', svgWidth);