mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-27 09:50:52 -05:00
fix Body.scale for circles, closes #234
This commit is contained in:
parent
93ba111164
commit
f428d6be58
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue