0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-03-14 00:38:41 -04:00
This commit is contained in:
Mofasa 2024-11-27 16:04:34 +00:00 committed by GitHub
commit 93bb22e2e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -373,8 +373,6 @@ var Mouse = require('../core/Mouse');
timestamp: engine.timing.timestamp
};
Events.trigger(render, 'beforeRender', event);
// apply background if it has changed
if (render.currentBackground !== background)
_applyBackground(render, background);
@ -385,6 +383,8 @@ var Mouse = require('../core/Mouse');
context.fillRect(0, 0, canvas.width, canvas.height);
context.globalCompositeOperation = 'source-over';
Events.trigger(render, 'beforeRender', event);
// handle bounds
if (options.hasBounds) {
// filter out bodies that are not in view