Commit 98d07b3
Fix text layout cache key for maxFontSizeMultiplier (#56960)
Summary:
Text layout measurement cache keys currently consider `fontSizeMultiplier` and `allowFontScaling`, but omit `maxFontSizeMultiplier`. When that cap changes, Fabric can reuse a stale measurement even though the effective scaled font size may change.
This adds `maxFontSizeMultiplier` to the layout-wise text attribute equality and hash helpers, and covers the cache-key behavior with focused C++ tests.
Fixes #56921.
## Changelog:
[GENERAL] [FIXED] - Include `maxFontSizeMultiplier` in Fabric text layout cache keys.
Pull Request resolved: #56960
Test Plan:
- `npx --yes clang-format --dry-run --Werror packages/react-native/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp`
- `git diff --check`
I could not run the native gtest target locally from this sparse checkout; the patch adds focused coverage in the existing `TextLayoutManagerTest.cpp` file.
Reviewed By: sammy-SC
Differential Revision: D106362229
Pulled By: javache
fbshipit-source-id: 8977afe60b497344713af437eec48d5340eaed6c1 parent 5fce2de commit 98d07b3
2 files changed
Lines changed: 36 additions & 6 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/textlayoutmanager
- tests
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
packages/react-native/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp
Lines changed: 33 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
| 10 | + | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
17 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
18 | 46 | | |
0 commit comments