@@ -176,7 +176,8 @@ var Body = require('./Body');
176176 * @return {composite } The original compositeA with the composite removed
177177 */
178178 Composite . removeComposite = function ( compositeA , compositeB , deep ) {
179- var position = Common . indexOf ( compositeA . composites , compositeB ) ;
179+ // var position = Common.indexOf(compositeA.composites, compositeB);
180+ var position = compositeA . composites . indexOf ( compositeB ) ;
180181 if ( position !== - 1 ) {
181182 Composite . removeCompositeAt ( compositeA , position ) ;
182183 Composite . setModified ( compositeA , true , true , false ) ;
@@ -229,7 +230,8 @@ var Body = require('./Body');
229230 * @return {composite } The original composite with the body removed
230231 */
231232 Composite . removeBody = function ( composite , body , deep ) {
232- var position = Common . indexOf ( composite . bodies , body ) ;
233+ // var position = Common.indexOf(composite.bodies, body);
234+ var position = composite . bodies . indexOf ( body ) ;
233235 if ( position !== - 1 ) {
234236 Composite . removeBodyAt ( composite , position ) ;
235237 Composite . setModified ( composite , true , true , false ) ;
@@ -282,7 +284,8 @@ var Body = require('./Body');
282284 * @return {composite } The original composite with the constraint removed
283285 */
284286 Composite . removeConstraint = function ( composite , constraint , deep ) {
285- var position = Common . indexOf ( composite . constraints , constraint ) ;
287+ // var position = Common.indexOf(composite.constraints, constraint);
288+ var position = composite . constraints . indexOf ( constraint ) ;
286289 if ( position !== - 1 ) {
287290 Composite . removeConstraintAt ( composite , position ) ;
288291 }
0 commit comments