fix(D.5.1): draw window-frame border over content (OnDrawAfterChildren)

UiNineSlicePanel drew its full chrome in OnDraw, before children, so content painted OVER the frame. The toolbar's row-2 right cap (0x100006C0, W=8) extends 2px past the 300px content and was poking over the frame's bottom-right border (the 'missing frame' the user circled). Split the panel: center fill stays in OnDraw (background, under content); the bevel border + grip move to a new UiElement.OnDrawAfterChildren hook (foreground, over content edges) so the frame is the outermost layer. Chat is unaffected (its content is inset 5px, so the border never overlaps it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-17 16:05:50 +02:00
parent b37db79a23
commit ceef739e1d
2 changed files with 25 additions and 5 deletions

View file

@ -167,6 +167,15 @@ public abstract class UiElement
/// </summary>
protected virtual void OnDraw(UiRenderContext ctx) { }
/// <summary>
/// Draw AFTER this element's own children, but still within this element's
/// transform/alpha (NOT a global pass like <see cref="OnDrawOverlay"/>). Use for a
/// window FRAME border, which must be the outermost layer drawn OVER its content's
/// edges (so content can't poke through the frame), while the frame's center fill
/// stays a background in <see cref="OnDraw"/>. Default: nothing.
/// </summary>
protected virtual void OnDrawAfterChildren(UiRenderContext ctx) { }
/// <summary>
/// Draw content that must sit ON TOP of the ENTIRE UI, regardless of this
/// element's position in the tree — open menus, dropdowns, tooltips. Called in
@ -228,6 +237,10 @@ public abstract class UiElement
for (int i = 0; i < ordered.Length; i++)
ordered[i].DrawSelfAndChildren(ctx);
}
// Foreground pass for this element (e.g. a window frame's border drawn
// OVER its content's edges). Default no-op for ordinary elements.
OnDrawAfterChildren(ctx);
}
finally
{