Repository navigation
Commit f653a87
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 2a2ccaa commit f653a87
1 file changed
Lines changed: 9 additions & 0 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
263 | 272 | | |
264 | 273 | | |
265 | 274 | | |
| |||
0 commit comments