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

Commit

Permalink
Fix crash iOS Label measure for RTL languages (#15605)
Browse files Browse the repository at this point in the history
* Update UIViewExtensions.cs

* Add token for provisionator

# Conflicts:
#	build/steps/build-windows.yml

* Update Platform.cs (#15601)

Co-authored-by: Rui Marinho <me@ruimarinho.net>
  • Loading branch information
jfversluis and rmarinho committed Nov 16, 2022
1 parent e1b760f commit a31ddcf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Xamarin.Forms.Platform.iOS/Extensions/UIViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,18 @@ internal static IEnumerable<UIView> DescendantsTree(this UIView self)
else
s = self.FittingSize;
#endif
var request = new Size(s.Width == float.PositiveInfinity ? double.PositiveInfinity : s.Width,
s.Height == float.PositiveInfinity ? double.PositiveInfinity : s.Height);

var width = s.Width;
var height = s.Height;

if (nfloat.IsNaN(width))
width = float.PositiveInfinity;

if (nfloat.IsNaN(height))
height = float.PositiveInfinity;

var request = new Size(width == float.PositiveInfinity ? double.PositiveInfinity : width,
height == float.PositiveInfinity ? double.PositiveInfinity : height);
var minimum = new Size(minimumWidth < 0 ? request.Width : minimumWidth,
minimumHeight < 0 ? request.Height : minimumHeight);
return new SizeRequest(request, minimum);
Expand Down

0 comments on commit a31ddcf

Please sign in to comment.