-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fill closed arrows in element_line() #2924
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
Fill closed arrows in element_line() #2924
Conversation
R/theme-elements.r
Outdated
@@ -226,9 +226,11 @@ element_grob.element_line <- function(element, x = 0:1, y = 0:1, | |||
default.units = "npc", id.lengths = NULL, ...) { | |||
|
|||
# The gp settings can override element_gp | |||
gp <- gpar(lwd = len0_null(size * .pt), col = colour, lty = linetype, lineend = lineend) | |||
gp <- gpar(lwd = len0_null(size * .pt), col = colour, lty = linetype, | |||
lineend = lineend, fill = colour) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use tidyverse-style formatting? The same applies for the other change.
gp <- gpar(
lwd = len0_null(size * .pt), col = colour, lty = linetype,
lineend = lineend, fill = colour
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe reorder the parameters so col
and fill
go together and then lwd
, lty
, and lineend
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
Thanks! This will have to wait until after the 3.1.0 release. |
Thanks for reviewing! I'll wait (and will add a NEWS bullet after the release). |
@clauswilke Could you review this again when you have time? |
Thanks! |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Fixes #2922
Currently,
element_grob.element_line()
doesn't specifyfill
ingpar()
. This PR specifies it to fill arrows.Created on 2018-10-02 by the reprex package (v0.2.1)
Note that, for consistency with
geom_segment()
andgeom_curve()
,element_line()
might needsarrow.fill
parameter, but it seems a bit harder to introduce a new parameter to theme. So, users need to rely on this workaround if they want different colours.