Skip to content

Fix viewport scaling and add ImGui scaling controls - #48

Merged
lbastigk merged 8 commits into
mainfrom
fix/viewport-scale
Oct 18, 2026
Merged

lbastigk merged 8 commits into
mainfrom
fix/viewport-scale

Conversation

@lbastigk

Copy link
Copy Markdown
Owner

Summary

Update renderer and tile scaling to account for the display's pixel scale, while keeping ImGui overlay coordinates in the logical window scale. Add renderer debug commands for tuning ImGui style, framebuffer, mouse, and render scaling.

Changes

  • Track SDL display scale and combine it with the configured window scale.
  • Use pixel scale when rendering tiles and converting logical rectangles to SDL render coordinates.
  • Keep a separate logical-scale conversion for ImGui tile metadata overlays.
  • Recalculate scaling when the window display scale changes or the window size scale is updated.
  • Apply configurable mouse and render multipliers during ImGui event processing and rendering.
  • Add the imguidb renderer module with these commands:
    • imguidb scale <scale>
    • imguidb framebuffer-scale <scale>
    • imguidb mouse-scale <scale>
    • imguidb render-scale <scale>

Testing

  • Tested layout of the vertical slice test, including imgui layout, on 100% and 150% display scaling
  • No new standard tests were added

@lbastigk
lbastigk merged commit 0a2413c into main Oct 18, 2026
2 checks passed
@lbastigk
lbastigk deleted the fix/viewport-scale branch October 18, 2026 11:26
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