Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
[WPF] Fix FormsPanel MeasureOverride negative requested size (#10653)
Browse files Browse the repository at this point in the history
* Update FormsPanel.cs

* Update FormsPanel.cs

* Update FormsPanel.cs

* fix

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
  • Loading branch information
tessarolli and samhouts authored Sep 9, 2020
1 parent d2e6cbb commit c05e04d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Xamarin.Forms.Platform.WPF/FormsPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ protected override System.Windows.Size MeasureOverride(System.Windows.Size avail
if (double.IsInfinity(elementDesiredWidth) || double.IsPositiveInfinity(elementDesiredHeight))
{
Size request = Element.Measure(elementDesiredWidth, elementDesiredHeight, MeasureFlags.IncludeMargins).Request;
if (request.Width == -1)
if (request.Width < 0)
request.Width = 0.0;

if (request.Height == -1)
if (request.Height < 0)
request.Height = 0.0;

result = new System.Windows.Size(request.Width, request.Height);
Expand Down

0 comments on commit c05e04d

Please sign in to comment.