mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-14 00:38:41 -04:00
Fixed composite bodies not added to allBodies list
This commit is contained in:
parent
076bee9099
commit
0ec05a8ec4
1 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,7 @@ var Grid = require('../collision/Grid');
|
|||
* @return {composite} A new composite
|
||||
*/
|
||||
Composite.create = function(options) {
|
||||
return Common.extend({
|
||||
var composite = Common.extend({
|
||||
id: Common.nextId(),
|
||||
type: 'composite',
|
||||
parent: null,
|
||||
|
@ -40,6 +40,10 @@ var Grid = require('../collision/Grid');
|
|||
label: 'Composite',
|
||||
plugin: {}
|
||||
}, options);
|
||||
|
||||
composite.allBodies = composite.bodies.slice();
|
||||
|
||||
return composite;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue