From f7f77b4cf88463fe0ec72592cc743fbf4b45c107 Mon Sep 17 00:00:00 2001 From: liabru Date: Mon, 11 Jun 2018 19:13:30 +0100 Subject: [PATCH] fix Composite.bounds global issue, closes #627, closes #544 --- src/body/Composite.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/body/Composite.js b/src/body/Composite.js index e2587ec..6df050a 100644 --- a/src/body/Composite.js +++ b/src/body/Composite.js @@ -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); }; /*