0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

handle missing options in Engine.create

This commit is contained in:
liabru 2016-04-19 11:19:03 +01:00
parent d373172c19
commit f36fe2c329

View file

@ -37,10 +37,11 @@ var Body = require('../body/Body');
* @return {engine} engine
*/
Engine.create = function(element, options) {
// options may be passed as the first (and only) argument
options = Common.isElement(element) ? options : element;
element = Common.isElement(element) ? element : null;
options = options || {};
var defaults = {
positionIterations: 6,