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:
parent
d373172c19
commit
f36fe2c329
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue