src/utils.js
function transformBoundingClientRectToDocument(box) {
      var t;
      const scrollX = (((t = document.documentElement) ||
        (t = document.body.parentNode)) &&
      typeof t.scrollLeft == "number"
        ? t
        : document.body
      ).scrollLeft;
  
      const scrollY = (((t = document.documentElement) ||
        (t = document.body.parentNode)) &&
      typeof t.scrollTop == "number"
        ? t
        : document.body
      ).scrollTop;
  
  
      //This assumes width == height
      const ttop = box.top - scrollY;
      const tleft = box.left - scrollX;
      //info needed to draw line from center to mousepos
  
      return {top: ttop, left: tleft, width:box.width, height: box.height}
    
  }
function transformBoundingClientRectToDocument(box) {
      var t;
      const scrollX = (((t = document.documentElement) ||
        (t = document.body.parentNode)) &&
      typeof t.scrollLeft == "number"
        ? t
        : document.body
      ).scrollLeft;
  
      const scrollY = (((t = document.documentElement) ||
        (t = document.body.parentNode)) &&
      typeof t.scrollTop == "number"
        ? t
        : document.body
      ).scrollTop;
  
  
      //This assumes width == height
      const ttop = box.top - scrollY;
      const tleft = box.left - scrollX;
      //info needed to draw line from center to mousepos
  
      return {top: ttop, left: tleft, width:box.width, height: box.height}
    
  }
Transforms the top/left variables of the rectangle
returned by getBoundingClientRect to document based coordinates
without the scroll.
UPDATE
@param {Rect} box