Don't let the PreviewerWindow grow without limit (#19957)

This commit is contained in:
Matt Lacey
2025-11-03 15:44:45 +00:00
committed by GitHub
parent 1a938de66d
commit c530f7b208
@@ -64,6 +64,12 @@ namespace Avalonia.DesignerSupport.Remote
public void Resize(Size clientSize, WindowResizeReason reason)
{
// Don't let it clientSize be unconstrained or risk running Out Of Memory
clientSize = new Size(
Math.Min(clientSize.Width, MaxAutoSizeHint.Width),
Math.Min(clientSize.Height, MaxAutoSizeHint.Height)
);
_transport.Send(new RequestViewportResizeMessage
{
Width = Math.Ceiling(clientSize.Width * RenderScaling),