Add IgnoreParentClip component to ignore parent element clipping #21836
+30
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Implement UI nodes that can ignore parent node clipping restrictions, but still are restricted by grandparent node clipping restrictions.
Useful for creating scroll-areas that utilize scrollbar-width provided by taffy. Using IgnoreParentClip it is possible to avoid two element hierarchy requirement for scroll-areas. Instead scrollbar overlay can be inserted as child element with
position: absolute; width: 100%; height: 100%; z-index: 1; ignore-scroll: true. Then scrollbars can be inserted inside this overlay element. If we want to place scrollbars on space provided byscrollbar-width, negative offset is needed, e.g.right: -8px. This goes outside clipping rect of scrollarea. Therefore functionality to ignore parent element clipping rect is needed.Solution
Introduce
IgnoreParentClipcomponent that instructs clipping rect calculations to use grand parent clipping rect in calculations for ui entities with this component.Testing