Skip to content

[0.69] Fix matrix multiplication logic for transforms (#10112)#10121

Merged
acoates-ms merged 1 commit intomicrosoft:0.69-stablefrom
rozele:0.69-stable-7f6367f
Jun 15, 2022
Merged

[0.69] Fix matrix multiplication logic for transforms (#10112)#10121
acoates-ms merged 1 commit intomicrosoft:0.69-stablefrom
rozele:0.69-stable-7f6367f

Conversation

@rozele
Copy link
Copy Markdown
Contributor

@rozele rozele commented Jun 15, 2022

Description

Backporting #10112 into v0.69.

Type of Change

Erase all that don't apply.

  • Bug fix (non-breaking change which fixes an issue)

Why

As reported in #10111, float4x4's operator* does not produce the same output as expected on other RN platforms.

Resolves #10111

What

This change ports the logic from RN's MatrixMath.js to ensure multiplication of transforms produces the same result on Windows as on iOS and Android.

Screenshots

Before After iOS
image image Screen Shot 2022-06-14 at 1 04 06 PM
image image Screen Shot 2022-06-14 at 1 06 04 PM

One more for good measure - notice that the JS driven animation just sends transform props (rather than computed matrix) now that we forked processTransform.windows.js, so the animation doesn't match expectations from the native driver / iOS:

Before:

React.Native.Playground.Win32.2022-06-14.13-30-28.mp4

After:

playground.2022-06-14.13-30-13.mp4

iOS:

Screen.Recording.2022-06-14.at.1.35.15.PM.mov

Testing

See screenshots / recordings above, confirmed that transforms compose as expected on iOS.

Microsoft Reviewers: Open in CodeFlow

* Uses custom matrix multiplication logic for transforms

As reported in microsoft#10111, float4x4's operator* does not produce the same
output as expected on other RN platforms. This change ports the logic
from RN's MatrixMath.js to ensure multiplication of transforms produces
the same result on Windows as on iOS and Android.

Fixes microsoft#10111

* yarn format

* Change files

* Use float4x4 operator* but get the order correct
@rozele rozele requested review from a team as code owners June 15, 2022 12:23
@rozele rozele changed the title Fix matrix multiplication logic for transforms (#10112) [0.69] Fix matrix multiplication logic for transforms (#10112) Jun 15, 2022
@acoates-ms acoates-ms merged commit 3b398b2 into microsoft:0.69-stable Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants