mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-31 18:14:55 -05:00
Fix #641 - Calling Body.setStatic(body, true) twice breaks the body
This commit is contained in:
parent
5a0079df1b
commit
610bd73053
1 changed files with 5 additions and 0 deletions
|
@ -249,6 +249,11 @@ var Axes = require('../geometry/Axes');
|
|||
Body.setStatic = function(body, isStatic) {
|
||||
for (var i = 0; i < body.parts.length; i++) {
|
||||
var part = body.parts[i];
|
||||
|
||||
if (part.isStatic === isStatic) {
|
||||
continue;
|
||||
}
|
||||
|
||||
part.isStatic = isStatic;
|
||||
|
||||
if (isStatic) {
|
||||
|
|
Loading…
Add table
Reference in a new issue