From c4092a04c29bfe909508809e74e7c2ff7000f09a Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Wed, 3 Aug 2022 15:06:39 -0400 Subject: [PATCH 1/2] Fix skew transforms for string values In #9798, we added functionality to update transform props directly without first converting those props into a transform matrix in JS. This change did not account for string values of skewX and skewY. Skew transforms can be specified in degrees (via string) rather than explicit float values. Ensure we call `ToRadians` before attempting to create the skew matrices. Fixes #10364 --- .../Views/FrameworkElementViewManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnext/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp b/vnext/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp index 412f4f90dc5..2442defbb8e 100644 --- a/vnext/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +++ b/vnext/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp @@ -235,12 +235,12 @@ bool FrameworkElementViewManager::UpdateProperty( MultiplyInto( transformMatrix, winrt::Windows::Foundation::Numerics::float4x4( - winrt::Windows::Foundation::Numerics::make_float3x2_skew(innerValue.AsSingle(), 0.f))); + winrt::Windows::Foundation::Numerics::make_float3x2_skew(ToRadians(innerValue), 0.f))); } else if (transformType == "skewY") { MultiplyInto( transformMatrix, winrt::Windows::Foundation::Numerics::float4x4( - winrt::Windows::Foundation::Numerics::make_float3x2_skew(0.f, innerValue.AsSingle()))); + winrt::Windows::Foundation::Numerics::make_float3x2_skew(0.f, ToRadians(innerValue)))); } } } From 0688beeb53d483163835dbae32eb3c2db3f668d5 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Wed, 3 Aug 2022 15:10:24 -0400 Subject: [PATCH 2/2] Change files --- ...ative-windows-7381bba4-15a0-458e-82c9-63951b1129c8.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-7381bba4-15a0-458e-82c9-63951b1129c8.json diff --git a/change/react-native-windows-7381bba4-15a0-458e-82c9-63951b1129c8.json b/change/react-native-windows-7381bba4-15a0-458e-82c9-63951b1129c8.json new file mode 100644 index 00000000000..24ff19c81ac --- /dev/null +++ b/change/react-native-windows-7381bba4-15a0-458e-82c9-63951b1129c8.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix skew transforms for string values", + "packageName": "react-native-windows", + "email": "erozell@outlook.com", + "dependentChangeType": "patch" +}