Skip to content

fix(web): center the isometric map grid on screen - #16

Merged
teceer merged 1 commit into
mainfrom
center-map-grid-on-screen
Aug 7, 2026
Merged

teceer merged 1 commit into
mainfrom
center-map-grid-on-screen

Conversation

@teceer

@teceer teceer commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • The isometric grid was positioned with a fixed top-left offset, so it rendered in the corner of the canvas instead of centered.
  • world.position is now recomputed each frame from the diamond's bounding box relative to app.screen, keeping it centered even as the canvas resizes (resizeTo: window).

Test plan

  • bunx biome check src/main.ts passes
  • Manual check in browser: grid appears centered on load and after resizing the window

The world container was pinned to a fixed offset from the top-left
corner, so the grid always rendered in the upper-left of the canvas
instead of the middle. Recompute the offset from the diamond's
bounding box every frame so it stays centered across window resizes.
@teceer
teceer merged commit 9ea89fe into main Aug 7, 2026
7 checks passed
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