You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As above, in my project Matter is not global variable, only by import like this import * as Matter from "matter-js";
that's why using Matter.Composite.bounds(composite) results in error because this function assumes that Matter will be global object:
Composite.bounds = function(composite) {
var bodies = Matter.Composite.allBodies(composite), // here
vertices = [];
for (var i = 0; i < bodies.length; i += 1) {
var body = bodies[i];
vertices.push(body.bounds.min, body.bounds.max);
}
return Matter.Bounds.create(vertices); // and here
};
so as long as I don't add manually Matter to be global, this method going to fail.
The text was updated successfully, but these errors were encountered:
As above, in my project
Matter
is not global variable, only by import like thisimport * as Matter from "matter-js";
that's why using
Matter.Composite.bounds(composite)
results in error because this function assumes that Matter will be global object:so as long as I don't add manually Matter to be global, this method going to fail.
The text was updated successfully, but these errors were encountered: