Skip to content

joryirving/windowstead #91: scale worker sprites proportionally to tile size - #98

Merged
joryirving merged 1 commit into
mainfrom
fix/issue-91-sprites-undersized
Apr 24, 2026
Merged

joryirving/windowstead #91: scale worker sprites proportionally to tile size#98
joryirving merged 1 commit into
mainfrom
fix/issue-91-sprites-undersized

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Fixes #91. Replaces hardcoded sprite sizes (22×28 overlay, 12×14 tile worker) with tile-size-relative dimensions. Sprites now scale with so they read appropriately in both bottom (46px tiles) and side-dock (55px tiles) modes.

@smurf-bot

smurf-bot Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: MiniMax-M2.7@https://api.minimax.io/v1

Recommendation: Approve

This PR correctly addresses issue #91 by replacing hardcoded sprite dimensions with tile-size-relative calculations.

Change-by-Change Findings

  1. render_worker_overlay() sprite sizing (line 1087)

    • Before: Vector2(22, 28) — hardcoded
    • After: Vector2(int(tile_size.x * 0.40), int(tile_size.y * 0.50))
    • Worker overlay sprites now scale at 40% of tile width and 50% of tile height
    • At 46px bottom tiles → ~18×23px; at 55px side tiles → ~22×28px
  2. render_worker_sprites() tile sprite sizing (line 1246)

    • Before: Vector2(12, 14) — hardcoded
    • After: Vector2(int(tile_size.x * 0.25), int(tile_size.y * 0.28))
    • Worker tile sprites now scale at 25% of tile width and 28% of tile height
    • At 46px bottom tiles → ~11×13px; at 55px side tiles → ~14×15px

Standards Compliance

  • Tile-first sizing: Sprite dimensions are now derived from tile_size rather than hardcoded values, consistent with the AGENTS.md guidance to choose "square tile geometry first, with tile size responsive to screen/work-area percentage, then derive dock size from the grid."
  • Both modes addressed: The proportional scaling works for bottom (46px) and side-dock (55px) tile sizes mentioned in the PR body and confirmed by repository test data (test_layout_math.gd lines 152-153, 159-160).
  • GDScript conventions: Using := type inference, proper Vector2 construction, int() casting for pixel dimensions — all consistent with repository style.

Linked Issue Fit

Acceptance Criteria Status
Tile content sprites scaled to fill tiles more appropriately ✅ Sprites now scale with tile_size rather than being hardcoded
Colonist sprites scaled/readable in side dock mode ✅ Both render_worker_overlay and render_worker_sprites use proportional sizing
Visually legible in built game ✅ Fixed ratios ensure consistent proportional fill across both dock modes

Unknowns / Needs Verification

  • Manual testing recommended: The issue notes that acceptance must be verified "in the built game, not just in isolated scene testing." While the code logic is sound, visual confirmation in both bottom and side-dock modes would be prudent.
  • Aspect ratio preservation: The hardcoded values (22×28, 12×14) had different aspect ratios than the proportional replacements. The new ratios (0.80 for overlay, ~0.89 for tile sprites) are slightly different from the originals. This may be intentional for improved legibility, but worth noting.

Conclusion

The implementation correctly solves the reported bug by making sprite sizing responsive to the dynamic tile_size variable, which adapts between bottom (46px) and side-dock (55px) modes. The changes are minimal, focused, and follow repository conventions.

@joryirving
joryirving merged commit 46d28ef into main Apr 24, 2026
4 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.

bug: side-dock sprites are undersized relative to their tiles

2 participants