function isPointWithinRect(x, y, rect) {

    return rect.width
      && rect.height
      && x >= rect.left
      && x < (rect.left + rect.width)
      && y >= rect.top
      && y < (rect.top + rect.height);

  }
/**
   * Check if a point (coordinate) is within a rectangle.
   *
   * @private
   * @param {Number} x
   * @param {Number} y
   * @param {Rectangle} rect
   * @return {Boolean}
   */
Check if a point (coordinate) is within a rectangle.
Check if a point ( coordinate ) is within a rectangle .
function isPointWithinRect(x, y, rect) {
    return rect.width
      && rect.height
      && x >= rect.left
      && x < (rect.left + rect.width)
      && y >= rect.top
      && y < (rect.top + rect.height);
  }
function isPointWithinRect ( x , y , rect ) { return rect . width && rect . height && x >= rect . left && x < ( rect . left + rect . width ) && y >= rect . top && y < ( rect . top + rect . height ) ; }
Check if a point (coordinate) is within a rectangle.
Check if a point ( coordinate ) is within a rectangle .