mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: In https://github.com/facebook/react-native/pull/45102 I've implemented a baseline alignment function for the new architecture. I've noticed one thing I've missed previously - `locationForGlyphAtIndex` is [relative to the line fragment](https://developer.apple.com/documentation/appkit/nslayoutmanager/1403239-locationforglyphatindex), not the container. This means that the attachments would be put in the wrong place in multiline text. This PR fixes that by adding the position of the entire line to the attachment position. ## Changelog: [IOS] [FIXED] - Fixed baseline attachment position in multiline text Pull Request resolved: https://github.com/facebook/react-native/pull/46172 Test Plan: Checked on relevant example of RNTester. |Before|After| |-|-| |<img width="546" alt="Screenshot 2024-08-22 at 15 53 14" src="https://github.com/user-attachments/assets/c1861655-9253-44fd-9f2f-796aff83df1e">|<img width="546" alt="Screenshot 2024-08-22 at 15 52 37" src="https://github.com/user-attachments/assets/27f07bc7-a8f6-4696-a414-815e7ece642c">| Reviewed By: andrewdacenko Differential Revision: D61662006 Pulled By: cipolleschi fbshipit-source-id: 5eafdae1800c06d9fc61bfac99584e6e25a05c24