Commit e40572b
committed
fix: keep BackgroundDrawable creation lazy, propagate bounds instead
Revert the eager ensureBackgroundDrawable call inside setBorderRadius
so views with borderRadius but no backgroundColor don't carry an
always-allocated drawable. Instead, fix the root timing issue at the
actual site of the bug: when ensureBackgroundDrawable lazily
constructs a new BackgroundDrawable + new composite, carry the
existing composite's bounds over before assigning view.background.
This primes the new drawable with the view's real dimensions so its
first draw computes the border-radius path correctly, without
imposing cost on views that never hit this path.
Test Plan: same RNTester repro (UI > Border > "Border radius with
transparent -> opaque background").1 parent ef91012 commit e40572b
1 file changed
Lines changed: 13 additions & 9 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
222 | 217 | | |
223 | 218 | | |
224 | 219 | | |
| |||
642 | 637 | | |
643 | 638 | | |
644 | 639 | | |
645 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
646 | 650 | | |
647 | 651 | | |
648 | 652 | | |
| |||
0 commit comments