jonmmease / avenger

Experimental Vega visualization renderer in Rust using wgpu
BSD 3-Clause "New" or "Revised" License
25 stars 1 forks source link

Support nested group clipping, and rounded corners in clipping #56

Closed jonmmease closed 6 months ago

jonmmease commented 9 months ago

Currently, marks may be clipped to the extent of their immediate group parent.

In Vega, if a group mark item has clip of true, then clipping is applied to child marks (overriding their own clip preference). And the group clipping applies to marks in child groups, even if the child group does not enable clipping.

To implement this in our wgpu renderer, I think we'll need to store an independent clipping rectangle in the mark uniforms. The origin of the clipping rectangle needs to be independent of the group origin. To be correct, the clipping regions will need to be intersected if child groups of a grouping with clipping enabled also enable their own clipping.

Additionally, group clipping should take into account the rounded corners of the group mark with clipping enabled.

Taken together, this is what's needed to support the rounded corners in https://altair-viz.github.io/gallery/bar_rounded.html.

jonmmease commented 6 months ago

This was done a while back