Skip to content

Commit 961b194

Browse files
Fix draw_key_rect() not using data$fill for glyph fill (#6609)
* Fix draw_key_rect() not using data$fill for glyph fill * Accept snapshot and update NEWS
1 parent 3142fac commit 961b194

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# ggplot2 (development version)
22

3+
### Bug fixes
4+
5+
* Fixed regression where `draw_key_rect()` stopped using `fill` colours
6+
(@mitchelloharawild, #6609).
7+
38
# ggplot2 4.0.0
49

510
## User facing

R/legend-draw.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ draw_key_abline <- function(data, params, size) {
5454
#' @export
5555
#' @rdname draw_key
5656
draw_key_rect <- function(data, params, size) {
57-
colour <- if (is.na(data$fill %||% NA)) data$colour
57+
colour <- if (is.na(data$fill %||% NA)) data$colour else data$fill
5858
rectGrob(gp = gg_par(
5959
col = NA,
6060
fill = fill_alpha(colour %||% "grey20", data$alpha),

tests/testthat/_snaps/legend-draw/all-legend-keys.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)