Skip to content

fix(tilemap): bounded parallax tile layers opt out of static-bounds culling#385

Merged
Exoridus merged 1 commit into
mainfrom
worktree-infinite-maps-slice2
Jul 17, 2026
Merged

fix(tilemap): bounded parallax tile layers opt out of static-bounds culling#385
Exoridus merged 1 commit into
mainfrom
worktree-infinite-maps-slice2

Conversation

@Exoridus

Copy link
Copy Markdown
Owner

Summary

Companion to the ImageLayerNode culling guard from #384, closing the symmetric pre-existing gap flagged there: RenderNode._collect runs the inView cull test before _collectContent applies the collect-time parallax position patch, so a bounded TileLayerNode with parallax !== 1 was culled against its static base-offset bounds while rendering at baseOffset + camCenter·(1−parallax) — divergence grows without bound with camera distance, so the layer could pop out while still partially on-screen.

Fix: the constructor's cullable = false guard (previously unbounded-only) now also covers parallax layers — same camera-dependent-position rationale as ImageLayerNode.

Verified in review

  • TileLayer.parallaxX/Y are readonly (no setter, single assignment) — the constructor-time guard is complete, no live-sync needed.
  • Per-chunk culling inside the node was already correct: the transform system re-derives lazily on read via version counters, and the position patch happens before super._collectContent recurses, so chunk inView sees the patched parent transform in the same frame. Only the node-level cull was stale.
  • TDD: new test is RED without the guard; existing bounded-non-parallax (cullable === true) and unbounded tests bracket the guard on both sides. Tilemap suite 468/468.

…ulling

The cull test runs before the collect-time parallax patch, so a bounded
parallax layer was culled at its base offset while rendering elsewhere
and could pop out on screen. Same camera-dependent-position rationale as
ImageLayerNode's guard.
@Exoridus
Exoridus enabled auto-merge (squash) July 17, 2026 00:04
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 1.21kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
exo-full-iife-Exo-iife 2.62MB 50 bytes (0.0%) ⬆️
exojs-tilemap-esm 351.51kB 1.16kB (0.33%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: exojs-tilemap-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
TileLayerNode.js 607 bytes 9.55kB 6.79% ⚠️
TileLayerNode.d.ts 557 bytes 5.87kB 10.48% ⚠️

Files in TileLayerNode.js:

  • ./src/TileLayerNode.ts → Total Size: 9.26kB
view changes for bundle: exo-full-iife-Exo-iife

Assets Changed:

Asset Name Size Change Total Size Change (%)
exo.full.iife.js 50 bytes 2.62MB 0.0%

Files in exo.full.iife.js:

  • ./packages/exojs-tilemap/src/TileLayerNode.ts → Total Size: 6.87kB

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@Exoridus
Exoridus merged commit 9b3de5f into main Jul 17, 2026
17 of 18 checks passed
@Exoridus
Exoridus deleted the worktree-infinite-maps-slice2 branch July 17, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant