code: function toLocalPoint(globalPosition) {
  
      var viewbox = canvas.viewbox();
  
      var clientRect = canvas._container.getBoundingClientRect();
  
      return {
        x: viewbox.x + (globalPosition.x - clientRect.left) / viewbox.scale,
        y: viewbox.y + (globalPosition.y - clientRect.top) / viewbox.scale
      };
    }
docs: /* convert a global event into local coordinates