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

Commit c05e04d

Browse files
tessarollisamhouts
andauthored
[WPF] Fix FormsPanel MeasureOverride negative requested size (#10653)
* Update FormsPanel.cs * Update FormsPanel.cs * Update FormsPanel.cs * fix Co-authored-by: Samantha Houts <[email protected]>
1 parent d2e6cbb commit c05e04d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Xamarin.Forms.Platform.WPF/FormsPanel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ protected override System.Windows.Size MeasureOverride(System.Windows.Size avail
7979
if (double.IsInfinity(elementDesiredWidth) || double.IsPositiveInfinity(elementDesiredHeight))
8080
{
8181
Size request = Element.Measure(elementDesiredWidth, elementDesiredHeight, MeasureFlags.IncludeMargins).Request;
82-
83-
if (request.Width == -1)
82+
83+
if (request.Width < 0)
8484
request.Width = 0.0;
8585

86-
if (request.Height == -1)
86+
if (request.Height < 0)
8787
request.Height = 0.0;
8888

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

0 commit comments

Comments
 (0)