code: function getCanvasPointClicked(e, canvas) {
    var rect = canvas.getBoundingClientRect();
    return {x: e.clientX - rect.left, y: e.clientY - rect.top};
  }
docs: Takes an event and returns the location clicked within the canvas element.