Repository navigation
Ultrawide: fix the menus' ring and cursor hit area on a wide frame - #230
Merged
YuutaTsubasa merged 1 commit intoOct 22, 2026
Merged
Conversation
… aspect The ring menu places the selected item's quad and tests the hand cursor against its items through two projection functions that map a 3D point onto the 1280x720 layout with the constants 640 and 360. With a wide frame's camera their x came out 1/k as far from the layout's middle as the GPU draws the ring (k: the camera's aspect over 16:9), so the selected item was drawn too narrow and the cursor had to be moved closer to the middle than the item looked to select it. Their x results are now stretched about 640 by k, read from the camera's own matrix, in the menus and in a race's pause menu. A 16:9 camera reads k = 1 and is left alone. See docs/main-menu.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
knuckleslee
marked this pull request as ready for review
October 21, 2026 18:12
YuutaTsubasa
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
@knuckleslee Thank you! This is in v0.10.22. We could only check that 16:9 menus are unchanged here, so your 32:9 test is the one that covers the fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Merge test done: this branch merged into
main0.10.16 and run in a full game session (see Tested).mainhas since moved to 0.10.17; GitHub reports this PR as mergeable.What
On an ultrawide window, the menus' ring is wrong in three ways:
The same happens in a race's pause menu (the ring and its widgets).
Why
The title turns a 3D position into a point of its 1280x720 layout with two functions:
8226CB10(the camera in the title's services) and823F18D0(a camera given by the caller). They take the point through the camera's matrix, divide by w and map it with the constants 640 and 360. With the wide frame's camera (its aspect is the frame's) the same normalized x covers k times more of the layout than 640 of it, which is where the GPU draws the ring; in the layout the items come out k times too close to its middle, so the selected item is drawn too narrow and the cursor hit area is where the item is not.Measured with a 16:9 run of the same menu: the selected item is at x = 847, 261 wide; on the wide frame the title computes 709 and 87 wide (k = 3.0 at 7680x1440), and the hand cursor selected it at x about 600 to 750.
Fix
In
game_patches.cppthe x results of both functions are stretched about 640 by k, the camera's aspect over 16:9, read from the camera's own matrix (the lengths of its x and y columns' first three entries). A camera that is 16:9 already reads k = 1 and is left alone. Only in the wide mode, in the menus' 1280-wide view, and in a race only for the pause menu's ring and widgets (the race HUD is placed by other means and is not touched). Notes indocs/main-menu.md.Tested
On Windows 10, a 7680x1440 window (aspect auto), the hand cursor:
Full game session with this branch merged into
main0.10.16: the menus and the pause menu behave as above, and a 16:9 window's menus are unchanged (checked).Not tested: a two-player race (I could not set one up), the pre-race calibration screen, and other aspect ratios than 32:9 and 16:9 (the camera aspect is read, not assumed, but I have only looked at those two).
🤖 Generated with Claude Code