0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

hide axis indicator on compound bodies

This commit is contained in:
liabru 2015-02-28 16:00:05 +00:00
parent ca75fde09a
commit 6a26696fc7

View file

@ -643,12 +643,14 @@ var Render = {};
} }
} }
} else { } else {
if (body.parts.length === 1) {
// render a single axis indicator // render a single axis indicator
c.moveTo(body.position.x, body.position.y); c.moveTo(body.position.x, body.position.y);
c.lineTo((body.vertices[0].x + body.vertices[body.vertices.length-1].x) / 2, c.lineTo((body.vertices[0].x + body.vertices[body.vertices.length-1].x) / 2,
(body.vertices[0].y + body.vertices[body.vertices.length-1].y) / 2); (body.vertices[0].y + body.vertices[body.vertices.length-1].y) / 2);
} }
} }
}
if (options.wireframes) { if (options.wireframes) {
c.strokeStyle = 'indianred'; c.strokeStyle = 'indianred';