[Fabric] Point scale factor update support #1844
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please select one of the following
Summary
Update the layout context to the right point scale factor when moving the window to a display with a different backing scale factor.
This is achieved by committing a cloned shadow tree and forcing yoga to re-evaluate the layout on all nodes so that the updated layout context would be assigned to all layoutable nodes through the updated layout metrics holding the point scale factor.
Changelog
[macOS] [ADDED] - Add support for point scale factor updates.
Test Plan
Tested by running RNTester on macOS with fabric (
RCT_NEW_ARCH_ENABLED=1
) and launching the API Border example.Setup one screen with a 1x scale factor and another screen with a 2x scale factor. Drag the window from one screen to the other and observe the re-render of the borders to the right resolution of the screen.