dist/melonjs.js
function setPoints(points) {
         var x = Infinity,
             y = Infinity,
             right = -Infinity,
             bottom = -Infinity;
         points.forEach(function (point) {
           x = Math.min(x, point.x);
           y = Math.min(y, point.y);
           right = Math.max(right, point.x);
           bottom = Math.max(bottom, point.y);
         });
         this.setShape(x, y, right - x, bottom - y);
         return this;
       }
function setPoints(points) {
         var x = Infinity,
             y = Infinity,
             right = -Infinity,
             bottom = -Infinity;
         points.forEach(function (point) {
           x = Math.min(x, point.x);
           y = Math.min(y, point.y);
           right = Math.max(right, point.x);
           bottom = Math.max(bottom, point.y);
         });
         this.setShape(x, y, right - x, bottom - y);
         return this;
       }
function setPoints ( points ) { var x = Infinity , y = Infinity , right = - Infinity , bottom = - Infinity ; points . forEach ( function ( point ) { x = Math . min ( x , point . x ) ; y = Math . min ( y , point . y ) ; right = Math . max ( right , point . x ) ; bottom = Math . max ( bottom , point . y ) ; } ) ; this . setShape ( x , y , right - x , bottom - y ) ; return this ; }
resize the rectangle to contain all the given points coordinates.
@name setPoints
@memberOf me.Rect.prototype
@function
@param {me.Vector2d[]} points array of vector defining a shape
@return {me.Rect} this shape bounding box Rectangle object
resize the rectangle to contain all the given points coordinates .