Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rectangles ignore linejoin settings #162

Closed
teunbrand opened this issue Mar 14, 2024 · 1 comment
Closed

rectangles ignore linejoin settings #162

teunbrand opened this issue Mar 14, 2024 · 1 comment

Comments

@teunbrand
Copy link

Hi Thomas,

In the new version of ragg, rectangles (not polygons in general) appear to ignore the linejoin setting.
When specifying a rectangle with linejoin = "mitre", I expected straight corners, but rounded corners show up.

library(grid)
tmp1 <- tempfile(fileext = ".png")
tmp2 <- tempfile(fileext = ".png")

draw_rect <- function() {
  grid.newpage()
  grid.rect(
    width = 0.5, height = 0.5,
    gp = gpar(lwd = 20, linejoin = "mitre")
  )
}

ragg::agg_png(tmp1)
draw_rect()
dev.off()
#> png 
#>   2
knitr::include_graphics(tmp1)

For reference how I expected the rectangle to look like:

png(tmp2, type = "cairo-png")
draw_rect()
dev.off()
#> png 
#>   2
knitr::include_graphics(tmp2)

Created on 2024-03-14 with reprex v2.1.0

@thomasp85
Copy link
Member

weird - I was sure I fixed that... Thanks for the report, I'll do it properly this time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants