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

geom_polygon() has useless lineend parameter #6140

Closed
teunbrand opened this issue Oct 16, 2024 · 1 comment
Closed

geom_polygon() has useless lineend parameter #6140

teunbrand opened this issue Oct 16, 2024 · 1 comment

Comments

@teunbrand
Copy link
Collaborator

teunbrand commented Oct 16, 2024

In addition to geom_polygon(), also other closed shape layers like geom_rect() have this parameter.
As these shapes are closed, there is no lineend to be drawn anywhere.

library(ggplot2)

ggplot(data.frame(x = c(1, 2, 2, NA), y = c(0, 0, 1, 1))) + 
  geom_polygon(
    aes(x, y),
    colour = "black", fill = 'grey50', linewidth = 5,
    lineend = "square"
  )

Created on 2024-10-16 with reprex v2.1.1

I think we should just throw the ignoring unknown parameter warning for these.

@teunbrand
Copy link
Collaborator Author

After some fooling around, I no longer think this is worth fixing:

  • It currently isn't doing any harm, it just isn't observed by closed shapes.
  • Changing the Geom$draw_*() signature to remove lineend can hurt extensions that directly pass arguments to such methods.
  • It'd invoke a lot of 'invisible' visual test updates, as the svg file will no longer contain the stroke-linecap: butt attribute in rectangles and polygons.

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

No branches or pull requests

1 participant