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:
parent
ca75fde09a
commit
6a26696fc7
1 changed files with 6 additions and 4 deletions
|
@ -643,10 +643,12 @@ var Render = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// render a single axis indicator
|
if (body.parts.length === 1) {
|
||||||
c.moveTo(body.position.x, body.position.y);
|
// render a single axis indicator
|
||||||
c.lineTo((body.vertices[0].x + body.vertices[body.vertices.length-1].x) / 2,
|
c.moveTo(body.position.x, body.position.y);
|
||||||
(body.vertices[0].y + body.vertices[body.vertices.length-1].y) / 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue