0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -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 * @return {engine} engine
*/ */
Engine.create = function(element, options) { Engine.create = function(element, options) {
// options may be passed as the first (and only) argument // options may be passed as the first (and only) argument
options = Common.isElement(element) ? options : element; options = Common.isElement(element) ? options : element;
element = Common.isElement(element) ? element : null; element = Common.isElement(element) ? element : null;
options = options || {};
var defaults = { var defaults = {
positionIterations: 6, positionIterations: 6,