Commit 6db021e
Override getClipBounds to expose overflow clipping to the framework
Summary:
Override `getClipBounds()` on ReactViewGroup to return the padding box rect when
`overflow` is hidden or scroll, gated behind the `syncAndroidClipBoundsWithOverflow`
feature flag. This allows systems that query `View.getClipBounds()` to determine
that a view clips its children, without the heavyweight side effects of
`setClipBounds()`.
Unlike `setClipBounds()`, this approach:
- Does not clip the view's own rendering at the RenderNode level (no border clipping)
- Does not require maintaining a Rect across size/border/overflow changes
- Computes the padding box rect lazily, only when queried
Adds `BackgroundStyleApplicator.getPaddingBoxRect()` (internal) which computes the
padding box (view bounds minus border insets) reusing the same border inset
resolution logic as `clipToPaddingBox()`.
Changelog: [Internal]
Differential Revision: D1023538401 parent 0de5a01 commit 6db021e
2 files changed
Lines changed: 64 additions & 0 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react
- uimanager
- views/view
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
468 | 499 | | |
469 | 500 | | |
470 | 501 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
820 | 821 | | |
821 | 822 | | |
822 | 823 | | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
823 | 856 | | |
824 | 857 | | |
825 | 858 | | |
| |||
0 commit comments