From 959db159fc9f8b21cd8ec2139f40fb66c8db487e Mon Sep 17 00:00:00 2001 From: Maarten Bezemer Date: Tue, 18 Jun 2024 09:40:02 +0200 Subject: [PATCH] Rebuild the full UI when the window is resized. This is required to fix misplaced elements that are anchored at the right of bottom sides of the window. --- Yafc.UI/Core/Window.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Yafc.UI/Core/Window.cs b/Yafc.UI/Core/Window.cs index 6d4c1f7f..6b6cf9bf 100644 --- a/Yafc.UI/Core/Window.cs +++ b/Yafc.UI/Core/Window.cs @@ -77,7 +77,10 @@ internal int CalculateUnitsToPixels(int display) { return desiredUnitsToPixels; } - internal virtual void WindowResize() => rootGui.Rebuild(); + internal virtual void WindowResize() { + rootGui.MarkEverythingForRebuild(); + rootGui.Rebuild(); + } internal void WindowMoved() { if (surface is null) { throw new InvalidOperationException($"surface must be set by a derived class before calling {nameof(WindowMoved)}."); }