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

Commit

Permalink
[iOS] Fix warnings on obsolete api (#15216)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarinho committed Mar 8, 2022
1 parent 55b0c13 commit 12708e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Xamarin.Forms.Platform.iOS.UnitTests/TransformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ static IEnumerable TransformationCases
[Description("View transformation should match renderer transformation")]
public async Task TransformationConsistent(View view)
{
#pragma warning disable CS0618 // Type or member is obsolete
var expected = new CATransform3D
{
m11 = -1.4984f,
Expand All @@ -39,6 +40,7 @@ public async Task TransformationConsistent(View view)
m42 = 30f,
m44 = 1f,
};

var actual = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true);
AssertTransform3DEqual(actual, expected, 0.0001);
}
Expand All @@ -62,5 +64,6 @@ private static void AssertTransform3DEqual(CATransform3D actual, CATransform3D e
Assert.That((double)actual.m43, Is.EqualTo((double)expected.m43).Within(delta));
Assert.That((double)actual.m44, Is.EqualTo((double)expected.m44).Within(delta));
}
#pragma warning restore CS0618 // Type or member is obsolete
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,11 @@ void AlignEmptyView()

if (isRtl)
{
#pragma warning disable CS0618 // Type or member is obsolete
if (_emptyUIView.Transform.xx == -1)
{
return;
}

FlipEmptyView();
}
else
Expand All @@ -515,6 +515,7 @@ void AlignEmptyView()
FlipEmptyView();
}
}
#pragma warning restore CS0618 // Type or member is obsolete
}

void FlipEmptyView()
Expand Down
2 changes: 2 additions & 0 deletions Xamarin.Forms.Platform.iOS/VisualElementTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ void update()

// not just an optimization, iOS will not "pixel align" a view which has m34 set
if (Math.Abs(rotationY % 180) > epsilon || Math.Abs(rotationX % 180) > epsilon)
#pragma warning disable CS0618 // Type or member is obsolete
transform.m34 = 1.0f / -400f;
#pragma warning restore CS0618 // Type or member is obsolete

if (Math.Abs(rotationX % 360) > epsilon)
transform = transform.Rotate(rotationX * (float)Math.PI / 180.0f, 1.0f, 0.0f, 0.0f);
Expand Down

0 comments on commit 12708e1

Please sign in to comment.