Browse Source

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

pull/19997/head
Matt Lacey 11 months ago
committed by GitHub
parent
commit
c530f7b208
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      src/Avalonia.DesignerSupport/Remote/PreviewerWindowImpl.cs

6
src/Avalonia.DesignerSupport/Remote/PreviewerWindowImpl.cs

@ -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),

Loading…
Cancel
Save