0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-26 13:49:01 -05:00

fix issue with Render.debug when no timing passed, closes #171 and #176

This commit is contained in:
liabru 2015-12-05 16:42:53 +00:00
parent 69ff33fc7b
commit 087fab245e

View file

@ -266,12 +266,18 @@ var Vector = require('../geometry/Vector');
if (engine.timing.timestamp - (render.debugTimestamp || 0) >= 500) {
var text = "";
if (metrics.timing) {
text += "fps: " + Math.round(metrics.timing.fps) + space;
}
// @if DEBUG
if (metrics.extended) {
if (metrics.timing) {
text += "delta: " + metrics.timing.delta.toFixed(3) + space;
text += "correction: " + metrics.timing.correction.toFixed(3) + space;
}
text += "bodies: " + bodies.length + space;
if (engine.broadphase.controller === Grid)