0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-11 16:00:48 -05:00

fix Composite.bounds global issue, closes #627, closes #544

This commit is contained in:
liabru 2018-06-11 19:13:30 +01:00
parent 0cf97f5c3c
commit f7f77b4cf8

View file

@ -15,6 +15,7 @@ module.exports = Composite;
var Events = require('../core/Events');
var Common = require('../core/Common');
var Bounds = require('../geometry/Bounds');
var Body = require('./Body');
(function() {
@ -539,7 +540,7 @@ var Body = require('./Body');
* @returns {bounds} The composite bounds.
*/
Composite.bounds = function(composite) {
var bodies = Matter.Composite.allBodies(composite),
var bodies = Composite.allBodies(composite),
vertices = [];
for (var i = 0; i < bodies.length; i += 1) {
@ -547,7 +548,7 @@ var Body = require('./Body');
vertices.push(body.bounds.min, body.bounds.max);
}
return Matter.Bounds.create(vertices);
return Bounds.create(vertices);
};
/*