Skip to content

Commit f34e0eb

Browse files
committed
change freeze() to make_fixed_copy()
1 parent 3592dbc commit f34e0eb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

NEWS.md

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

3-
* (internal) The ViewScale class has a `freeze()` method to permit copying
4-
trained position scales (#3441).
3+
* (internal) The ViewScale class has a `make_fixed_copy()` method to permit
4+
copying trained position scales (#3441).
55
* New parameters for `geom_label()` (@teunbrand and @steveharoz, #5365):
66
* The `linewidth` aesthetic is now applied and replaces the `label.size`
77
argument.

R/scale-view.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ ViewScale <- ggproto("ViewScale", NULL,
151151

152152
self$rescale(b)
153153
},
154-
freeze = function(self) {
154+
make_fixed_copy = function(self) {
155155
breaks <- self$get_breaks()
156156
minor <- self$get_breaks_minor()
157157
transform <- self$scale$get_transformation()

tests/testthat/test-scales.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ test_that("discrete scales work with NAs in arbitrary positions", {
748748

749749
})
750750

751-
test_that("ViewScales can be frozen", {
751+
test_that("ViewScales can make fixed copies", {
752752

753753
p1 <- ggplot(mpg, aes(drv, displ)) +
754754
geom_boxplot() +
@@ -761,8 +761,8 @@ test_that("ViewScales can be frozen", {
761761
p2 <- ggplot(mpg, aes(drv, cyl)) +
762762
geom_violin() +
763763
annotate("point", x = 15, y = 100) +
764-
b1$x$freeze() +
765-
b1$y$freeze()
764+
b1$x$make_fixed_copy() +
765+
b1$y$make_fixed_copy()
766766
b2 <- ggplot_build(p2)
767767

768768
# Breaks and labels should respect p1's limits

0 commit comments

Comments
 (0)