Commit a20fbe6
Fix text decoration color fallback to use per-span foreground color
Summary:
D104680895 introduced custom decoration drawing that falls back to `layout.paint.color` when `textDecorationColor` is not set. This is the base paint color (typically black), not the actual foreground color of the text span. For text with `ForegroundColorSpan` (e.g., link text with teal color, white text on dark backgrounds), the decoration was drawn in the wrong color.
Fix: when `textDecorationColor` is TRANSPARENT (default), look up the `ForegroundColorSpan` at the decoration start position and use its color instead.
Changelog: [Android][Fixed] - Fix text decoration color not matching foreground color when `textDecorationColor` is not set
Differential Revision: D1076451911 parent 503c0a5 commit a20fbe6
1 file changed
Lines changed: 14 additions & 1 deletion
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
| |||
0 commit comments