Skip to content

Commit

Permalink
fixed issue with Matter.RenderPixi not being cleared when bodies remo…
Browse files Browse the repository at this point in the history
…ved, closes #218
  • Loading branch information
liabru committed Jun 25, 2016
1 parent ad033f5 commit 4972af8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ var Common = require('./Common');
&& engine.render
&& engine.render.controller
&& engine.render.controller.clear) {
engine.render.controller.clear(engine.render);
engine.render.controller.clear(engine.render); // @deprecated
}

// update
Expand Down
6 changes: 6 additions & 0 deletions src/render/RenderPixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = RenderPixi;

var Composite = require('../body/Composite');
var Common = require('../core/Common');
var Events = require('../core/Events');

(function() {

Expand Down Expand Up @@ -98,6 +99,11 @@ var Common = require('../core/Common');
}
};

// event listeners
Events.on(render.engine, 'beforeUpdate', function() {
RenderPixi.clear(render);
});

// caches
render.textures = {};
render.sprites = {};
Expand Down

0 comments on commit 4972af8

Please sign in to comment.