MCPcopy Create free account
hub / github.com/melonjs/melonJS / refreshAbsoluteBounds

Function refreshAbsoluteBounds

packages/melonjs/src/level/tiled/TMXTileMap.js:126–133  ·  view source on GitHub ↗

* Recursively recompute absolute bounds for a container and all its * descendants. Used when the container's pos changes (centering on a wider * viewport): children cache their absolute bounds at addChild time, and * those caches are stale until each child happens to call updateBounds on * its o

(container)

Source from the content-addressed store, hash-verified

124 * @ignore
125 */
126function refreshAbsoluteBounds(container) {
127 container.forEach((child) => {
128 child.updateBounds(true);
129 if (child instanceof Container) {
130 refreshAbsoluteBounds(child);
131 }
132 });
133}
134
135/**
136 * a TMX Tile Map Object

Callers 1

_setBoundsMethod · 0.85

Calls 2

forEachMethod · 0.45
updateBoundsMethod · 0.45

Tested by

no test coverage detected