Don't let the PreviewerWindow grow without limit (#19957)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user