0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-24 13:29:01 -05:00

fix Body.scale for circles, closes #234

This commit is contained in:
liabru 2016-04-07 19:50:07 +01:00
parent 93ba111164
commit f428d6be58

View file

@ -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;