code: function lineRectangleIntersection(line, rect) {
    const intersections = [];
  
    Object.keys(rect).forEach(function(side) {
      const segment = rect[side];
      const intersection = line.intersectLine(segment);
  
      if (intersection) {
        intersections.push(intersection);
      }
    });
  
    return intersections;
  }
docs: Gets all the intersections of a line with a rect.
  @private
  @method
  @name lineRectangleIntersection
  
  @param  {Object} line The line to check.
  @param  {Object} rect The rect being intersected.
  @returns {Object[]} An array of the intersections.