0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

Changed bounds checking MIN_VALUE to -MAX_VALUE. Fixes #202

WIP #202. Changing Number.MAX_VALUE to Infinity
This commit is contained in:
Brian Broll 2016-02-04 09:33:21 -06:00
parent 34fa27ac97
commit dd5e2602e9

View file

@ -36,10 +36,10 @@ module.exports = Bounds;
* @param {vector} velocity
*/
Bounds.update = function(bounds, vertices, velocity) {
bounds.min.x = Number.MAX_VALUE;
bounds.max.x = Number.MIN_VALUE;
bounds.min.y = Number.MAX_VALUE;
bounds.max.y = Number.MIN_VALUE;
bounds.min.x = Infinity;
bounds.max.x = -Infinity;
bounds.min.y = Infinity;
bounds.max.y = -Infinity;
for (var i = 0; i < vertices.length; i++) {
var vertex = vertices[i];