Repository navigation
UI Scaling - #126
UI Scaling#126mightbemyname wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Thanks for a good PR!
Ok some issues, two blockers:
- If you scale below 90 % the dropdown menus break. Either don't scale below 100 % or fix that.
- Target indicator in monsters behaves weird when scale is 150 %. That needs fixing.** Claude also said this regarding this:
_"The vivid target indicator is the bracket drawn around the creature you have selected. To place it, the code projects the creature's 3-D position onto the screen and gets a pixel coordinate, say (1200, 600) on a 1920×1080 window. It then writes that number straight into the bracket's UI position.
With PR #126, every UI element's position is multiplied by the scale when drawn. At 150% the bracket at (1200, 600) is drawn at (1800, 900). The creature is still at pixel (1200, 600), because the 3-D scene is not scaled. So the bracket sits 600 pixels right and 300 pixels down from the creature.
The error is proportional to the distance from the top-left corner, which is why it is worse toward the bottom-right. A creature at the very top-left corner would still be framed correctly.
The fix is one line: divide the projected coordinate by the scale before handing it to the UI, so the draw-time multiply brings it back to the real pixel._
It also had some comments, more polish: (nothing I noted)
_Creature preview is soft. The examine window shows the creature rendered into a small off-screen image, then draws that image inside the window. The image size comes from the window's size in UI units. At 200% the window is drawn twice as big on screen but the image is still made at the small size, so it is stretched up and looks blurry. Fix: make the image at the size times the scale.
Half-pixels at odd scales. At 110% a 100-pixel wide element becomes 110 pixels, fine. But a border piece at position 37 becomes 40.7. The GPU blends that across two pixels, so edges look fuzzy and the joins between window-border pieces show thin gaps or overlaps. Rounding every scaled position to a whole pixel avoids it. At exactly 200% or 300% there are no fractions, but the PR also switches to smooth texture filtering for any scale other than 100%, so those are blurred too when they need not be.
Setting stored in the wrong place. The UI scale is saved inside the chat section of the settings file. It has nothing to do with chat. Once users have files with it there, moving it means a migration, so better to put it in the right place before merging.
Shared slider code changed. To make the new slider work, the author changed a helper that all numeric sliders share, including the two audio volume sliders and the render-pack settings. The reviewer traced it and thinks it is harmless, but no test covers those sliders, so a regression there would go unnoticed._
Summary
Testing
This is an optional accessibility/display setting; the default remains 100%.