Repository navigation
fix(ui): the overlay layers follow the interface root's size - #209
Merged
eriknihlen merged 1 commit intoOct 8, 2026
Merged
Conversation
Entering the world restores the window layout, which sizes the interface root and records the screen size without telling the overlay host. The next draw then saw no change and never resized the overlay layers, so they stayed at the pre-game 800x600 and a plugin canvas was clipped outside that rectangle. It only came right when a world overlay with something to draw pushed its camera viewport into the shared rectangle, or the window was resized again. The host now follows its interface root: the runtime calls FollowRoot every frame, and the world overlays no longer write the shared rectangle. They still size their own elements from the camera. Claude-Session: https://claude.ai/code/session_01SY57mHJLZ6djpWZ5nP37Tw
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.
Problem
After entering the world, plugin canvases are clipped to the top-left 800x600 of the screen.
RetailUiRuntime.RestoreLayout()runs when the character enters the world. That is when the window switches from the pre-game 800x600 to the game resolution. It sizes the interface root and records the new size in_lastScreenSize, but never tells the overlay host. The nextDrawsees no change, so its guardedSetViewport(screenSize)never runs, and every overlay layer keeps its 800x600 rectangle. Layers clip their children, so a canvas outside that rectangle is cut off.It looks intermittent because the world label and projectile overlays call
SetViewport(camera.Viewport)whenever they have something to draw. While labels are on screen, they push the right size in and hide the bug.Fix
UiOverlayHost.SetViewportis replaced byFollowRoot(), which takes its size from the interface root.RetailUiRuntime.Drawcalls it every frame, so a resize made anywhere reaches the layers.Tests
UiOverlayHostTests: layers follow a root resized behind the host's back, and a world overlay ticking with a different camera viewport leaves the layers at screen size.https://claude.ai/code/session_01SY57mHJLZ6djpWZ5nP37Tw