Commit 9542b15
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 update
that keeps the frame reaches onDraw with no Layout and the decorations are skipped.
Any animation that changes textDecorationLine or textDecorationColor hits this on
every frame, so the decoration never shows. Rebuild the Layout at the current size
before painting; TextView.onDraw would build one for the plain text anyway.1 parent a9307d8 commit 9542b15
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