Merge pull request #4170 from maikthomas/issue/4168-staticbody-drawdebug-circle

[issue/4168] draw circular StaticBody as circle in drawDebug
This commit is contained in:
Richard Davey 2018-11-20 09:44:47 +00:00 committed by GitHub
commit 824e224042
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -788,10 +788,21 @@ var StaticBody = new Class({
{
var pos = this.position;
var x = pos.x + this.halfWidth;
var y = pos.y + this.halfHeight;
if (this.debugShowBody)
{
graphic.lineStyle(1, this.debugBodyColor, 1);
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
if (this.isCircle)
{
graphic.strokeCircle(x, y, this.width / 2);
}
else
{
graphic.strokeRect(pos.x, pos.y, this.width, this.height);
}
}
},