0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-03-10 00:06:42 -04: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 * @param {vector} velocity
*/ */
Bounds.update = function(bounds, vertices, velocity) { Bounds.update = function(bounds, vertices, velocity) {
bounds.min.x = Number.MAX_VALUE; bounds.min.x = Infinity;
bounds.max.x = Number.MIN_VALUE; bounds.max.x = -Infinity;
bounds.min.y = Number.MAX_VALUE; bounds.min.y = Infinity;
bounds.max.y = Number.MIN_VALUE; bounds.max.y = -Infinity;
for (var i = 0; i < vertices.length; i++) { for (var i = 0; i < vertices.length; i++) {
var vertex = vertices[i]; var vertex = vertices[i];