Skip to content

Commit

Permalink
fix issue with Render.debug when no timing passed, closes #171 and #176
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Dec 5, 2015
1 parent 69ff33f commit 087fab2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,18 @@ var Vector = require('../geometry/Vector');

if (engine.timing.timestamp - (render.debugTimestamp || 0) >= 500) {
var text = "";
text += "fps: " + Math.round(metrics.timing.fps) + space;

if (metrics.timing) {
text += "fps: " + Math.round(metrics.timing.fps) + space;
}

// @if DEBUG
if (metrics.extended) {
text += "delta: " + metrics.timing.delta.toFixed(3) + space;
text += "correction: " + metrics.timing.correction.toFixed(3) + space;
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)
Expand Down

0 comments on commit 087fab2

Please sign in to comment.