thomasp85 / patchwork

The Composer of ggplots
https://patchwork.data-imaginist.com
Other
2.46k stars 162 forks source link

Use `calc_element()` instead of theme subsetting #365

Closed teunbrand closed 2 months ago

teunbrand commented 3 months ago

Hi Thomas,

This PR adresses an issue we talked about off-github. To briefly recap, for the next release that is still far off, {ggplot2} intends to use calculated elements for various theme spacings/margins. {patchwork} currently subsets several of these elements directly from the theme, sometimes resulting in invalid input for downstream grid/gtable functions. The fix would be to use calc_element() to ensure any calculated properties are passed on correctly, instead of subsetting the theme.

teunbrand commented 3 months ago

Some failing visual tests appear unrelated to this PR. Maybe they became slightly out of date somewhere after ggplot2 3.5.0? In any case, these are not human visible changes in the snapshots.

thomasp85 commented 2 months ago

Thanks