Skip to content

rectangles ignore linejoin settings #162

Description

@teunbrand

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions