Skip to content

Commit

Permalink
fix Body.scale for circles, closes #234
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Apr 7, 2016
1 parent 93ba111 commit f428d6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,16 @@ var Axes = require('../geometry/Axes');
Bounds.update(part.bounds, part.vertices, body.velocity);
}

// handle circles
if (body.circleRadius) {
if (scaleX === scaleY) {
body.circleRadius *= scaleX;
} else {
// body is no longer a circle
body.circleRadius = null;
}
}

if (!body.isStatic) {
var total = _totalProperties(body);
body.area = total.area;
Expand Down

0 comments on commit f428d6b

Please sign in to comment.