Skip to content

Commit

Permalink
show debug stats in dev demo
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Apr 25, 2021
1 parent c5028d5 commit 2f14ec5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions demo/src/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ var demo = function(examples, isDev) {
document.body.appendChild(demo.dom.root);
document.title = 'Matter.js Demo' + (isDev ? ' ・ Dev' : '');

MatterTools.Demo.start(demo);

if (isDev) {
var buttonSource = demo.dom.buttonSource;
var buttonCompare = buttonSource.cloneNode(true);
Expand All @@ -55,7 +53,13 @@ var demo = function(examples, isDev) {
event.preventDefault();
});
buttonSource.parentNode.insertBefore(buttonCompare, buttonSource.nextSibling);

Matter.before('Render.create', function(renderOptions) {
renderOptions.options.showDebug = true;
});
}

MatterTools.Demo.start(demo);
};

module.exports = { demo: demo };

0 comments on commit 2f14ec5

Please sign in to comment.