Skip to content

refit map when viewport size changes - #240

Open
treeform wants to merge 2 commits into
masterfrom
heartleaf-map-viewport-refit
Open

refit map when viewport size changes#240
treeform wants to merge 2 commits into
masterfrom
heartleaf-map-viewport-refit

Conversation

@treeform

Copy link
Copy Markdown
Contributor

Summary

  • Refit the global/replay map when a map layer viewport size changes, even after pan or zoom.
  • Fixes Heartleaf gnome POV becoming a postage stamp when switching from the full village to the 320x200 follow camera.

Test plan

  • nim r tests/test_client.nim
  • Open a Heartleaf global spectator, pan the map, click a gnome name, confirm the follow camera fills the window.

Made with Cursor

treeform and others added 2 commits August 14, 2026 12:02
Co-authored-by: Cursor <cursoragent@cursor.com>
The Nim/wasm global client drew UI layers at a fixed 3x, so a small
embed (softmax.com's ~875x500 Heartleaf replay frame) clipped the
bottom bar and overlapped the score panel. Pick the largest stepped
zoom (0.5, 1, 2, 3, 4) at which every UI layer fits the window with
1.5x padding, like Polyworld's stepped HUD scale, and use the same
steps in the HTML global client. Layer textures use linear
minification so 0.5x UI and zoomed-out maps average pixels instead of
dropping rows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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