fix(studio): Task 3 review — UiRoot.Pick, RenderStack IDisposable, dt cleanup

Code-review follow-ups to the ImGui inspector:
- Add public UiRoot.Pick(x,y) over the private HitTestTopDown (honors
  Z-order + modal exclusivity); StudioWindow uses it instead of a manual
  UiElement.HitTest with subtracted ScreenPosition.
- RenderStack : IDisposable — disposes the GL pieces it owns in one place;
  StudioWindow OnClosing + Dispose both call _stack?.Dispose(), closing the
  error-path leak (only UiHost was disposed on the Dispose-without-OnClosing
  path).
- Drop the stale _dt field; OnRender passes its own dt to Tick + BeginFrame.
- Fix a stale PanelFbo comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-25 15:14:47 +02:00
parent d2240974ec
commit 101a35cc2d
4 changed files with 32 additions and 25 deletions

View file

@ -655,6 +655,10 @@ public sealed class UiRoot : UiElement
return (null, 0, 0);
}
/// <summary>Public hit-test for tooling (the UI Studio inspector): the topmost element under
/// (x,y) in root space, honoring modal exclusivity + Z-order. Wraps the private HitTestTopDown.</summary>
public UiElement? Pick(int x, int y) => HitTestTopDown(x, y).element;
private static UiElement? FindWindow(UiElement? e)
{
while (e is not null)