0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-21 17:14:38 -05:00

Fix issue with 'Bodies.circle' usage.

This commit is contained in:
stacew 2023-12-23 01:59:28 +09:00
parent 7ec38a1f1c
commit 7ede227cf4

View file

@ -116,6 +116,9 @@ var Vector = require('../geometry/Vector');
* @return {body} A new circle body
*/
Bodies.circle = function(x, y, radius, options, maxSides) {
if( radius === 0 )
throw new Error('The radius of `Bodies.circle` must be non-zero.');
options = options || {};
var circle = {