0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -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
*/
Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) {
radius = radius || [8];
if (!radius.length)
if (typeof radius === 'number') {
radius = [radius];
} else {
radius = radius || [8];
}
// quality defaults to -1, which is auto
quality = (typeof quality !== 'undefined') ? quality : -1;