r-lib / marquee

Markdown Parser and Renderer for R Graphics
https://marquee.r-lib.org
Other
82 stars 1 forks source link

Textbox clipping with {ragg} #25

Closed teunbrand closed 3 months ago

teunbrand commented 3 months ago

Hi Thomas,

I'm not sure wether this issue belongs to {ragg} or {marquee}, but since you maintain both it should at least be adressed to the correct person 😅 When adding a textbox through the style and render the grob with {ragg}, I find sometimes the text appears to be clipped to the box. In the example below, one'd expect "I'm" and "ith padding" to be rendered as well.

library(marquee)

s <- classic_style() |>
  modify_style("block", background = "grey50", padding = trbl(rem(1)))

grob <- marquee_grob("I'm a {.block textbox} with padding", s)

tmp <- tempfile(fileext = ".png")
ragg::agg_png(tmp, height = 50)
grid::grid.newpage()
grid::grid.draw(grob)
dev.off()
#> png 
#>   2

knitr::include_graphics(tmp)

Created on 2024-06-02 with reprex v2.1.0

thomasp85 commented 3 months ago

Do you have an updated ragg installation? Pretty sure this was fixed by the latest release

teunbrand commented 3 months ago

Argh, yes you're right! I do apologise for the noise