0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-30 10:20:52 -05:00

fix Vertices.chamfer radius argument, closes #467

This commit is contained in:
liabru 2017-11-22 21:42:08 +00:00
parent 18a084574e
commit 3bceef4f7e

View file

@ -268,10 +268,11 @@ var Common = require('../core/Common');
* @param {number} qualityMax * @param {number} qualityMax
*/ */
Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) { Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) {
radius = radius || [8]; if (typeof radius === 'number') {
if (!radius.length)
radius = [radius]; radius = [radius];
} else {
radius = radius || [8];
}
// quality defaults to -1, which is auto // quality defaults to -1, which is auto
quality = (typeof quality !== 'undefined') ? quality : -1; quality = (typeof quality !== 'undefined') ? quality : -1;