Skip to content

Commit

Permalink
changed Render.bodyIds to show all parts
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Mar 9, 2015
1 parent bf11ee5 commit 3ed8034
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,17 +758,21 @@ var Render = {};
* @param {RenderingContext} context
*/
Render.bodyIds = function(engine, bodies, context) {
var c = context;

for (var i = 0; i < bodies.length; i++) {
var body = bodies[i];
var c = context,
i,
j;

if (!body.render.visible)
for (i = 0; i < bodies.length; i++) {
if (!bodies[i].render.visible)
continue;

c.font = "12px Arial";
c.fillStyle = 'rgba(255,255,255,0.5)';
c.fillText(body.id, body.position.x + 10, body.position.y - 10);
var parts = bodies[i].parts;
for (j = parts.length > 1 ? 1 : 0; j < parts.length; j++) {
var part = parts[j];
c.font = "12px Arial";
c.fillStyle = 'rgba(255,255,255,0.5)';
c.fillText(part.id, part.position.x + 10, part.position.y - 10);
}
}
};

Expand Down

0 comments on commit 3ed8034

Please sign in to comment.