Repository navigation
Commit c86e46f
committed
Rebuild the TextView Layout before drawing text effects on Android
ReactTextView.onDraw paints CanvasEffectSpans (underline, strikethrough) only when
getLayout() is non-null. TextView drops its Layout in setText and rebuilds it in
onMeasure, and Fabric measures a view only when its frame changed, so a text state
update that keeps the frame (a decoration or color change on a text of the same
size) reaches onDraw with no Layout and the decorations are skipped until something
else re-measures the view. Rebuild the Layout at the current size before painting;
TextView.onDraw would build one for the plain text anyway.1 parent a9307d8 commit c86e46f
1 file changed
Lines changed: 11 additions & 0 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
260 | 271 | | |
261 | 272 | | |
262 | 273 | | |
| |||
0 commit comments