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:
parent
34fa27ac97
commit
dd5e2602e9
1 changed files with 4 additions and 4 deletions
|
@ -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];
|
||||||
|
|
Loading…
Add table
Reference in a new issue