Skip to content

Commit

Permalink
Set index to 0 by default for getShape() and fixed the function d…
Browse files Browse the repository at this point in the history
…escription

this will help avoid basic issue/exception when migrating from 1.1.0
  • Loading branch information
obiot committed Nov 17, 2014
1 parent b2ec8dc commit deabec0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/physics/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@
},

/**
* return the current collision shape for this entity
* return the collision shape at the given index
* @name getShape
* @memberOf me.Body
* @public
* @function
* @param {Number} index the shape object at the specified index
* @param {Number} [index=0] the shape object at the specified index
* @return {me.Polygon|me.Line|me.Ellipse} shape a shape object
*/
getShape : function (index) {
return this.shapes[index];
return this.shapes[index || 0];
},

/**
Expand Down

0 comments on commit deabec0

Please sign in to comment.