Skip to content

Ultrawide: fix the menus' ring and cursor hit area on a wide frame - #230

Merged
YuutaTsubasa merged 1 commit into
YuutaTsubasa:mainfrom
knuckleslee:pr/ultrawide-menu-projection
Oct 22, 2026
Merged

YuutaTsubasa merged 1 commit into
YuutaTsubasa:mainfrom
knuckleslee:pr/ultrawide-menu-projection

Conversation

@knuckleslee

@knuckleslee knuckleslee commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Status

Merge test done: this branch merged into main 0.10.16 and run in a full game session (see Tested). main has 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 selected (hovered) item is drawn much too narrow;
  • the hand cursor has to be moved closer to the middle of the screen than the item looks to select it;
  • the Back button is selected about 300 px to the left of where it is drawn.

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) and 823F18D0 (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.cpp the 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 in docs/main-menu.md.

Tested

On Windows 10, a 7680x1440 window (aspect auto), the hand cursor:

  • main menu: the hovered item is round and where it is drawn, and the cursor selects it where it looks;
  • Back and the confirm arrow: selected where they are drawn;
  • a race's pause menu: items not narrowed, cursor selects where it looks, race HUD unchanged.

Full game session with this branch merged into main 0.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

… 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
knuckleslee marked this pull request as ready for review October 21, 2026 18:12
@YuutaTsubasa
YuutaTsubasa merged commit d34bea3 into YuutaTsubasa:main Oct 22, 2026
4 checks passed
YuutaTsubasa added a commit that referenced this pull request Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YuutaTsubasa

Copy link
Copy Markdown
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.

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.

2 participants