Skip to content

Commit d81ea71

Browse files
author
Yunuuuu
committed
refactor: remove unused attributes
1 parent e47212b commit d81ea71

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

R/alignpatch-free-align.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ free_align.ggalign_free_align <- function(plot, axes = "tlbr") {
148148
#' @importFrom ggplot2 ggproto ggproto_parent
149149
#' @export
150150
patch.ggalign_free_align <- function(x) {
151-
Parent <- NextMethod()
152151
axes <- setup_position(attr(x, "ggalign_free_axes", exact = TRUE))
152+
attr(x, "ggalign_free_axes") <- NULL
153+
Parent <- NextMethod()
153154
ggproto(
154155
"PatchFreeAlign", Parent,
155156
border_sizes = function(self, gt) {

R/alignpatch-free-border.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ free_border.ggalign_free_border <- function(plot, borders = "tlbr") {
5656
#' @importFrom gtable is.gtable
5757
#' @export
5858
patch.ggalign_free_border <- function(x) {
59-
Parent <- NextMethod()
6059
borders <- setup_position(attr(x, "ggalign_free_borders", exact = TRUE))
60+
attr(x, "ggalign_free_borders") <- NULL
61+
Parent <- NextMethod()
6162
ggproto(
6263
"PatchFreeBorder", Parent,
6364
align_border = function(self, gt, t, l, b, r) {

R/alignpatch-free-guide.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ free_guide.ggalign_free_guide <- function(plot, guides = "tlbr") {
3535
#' @importFrom ggplot2 ggproto ggproto_parent
3636
#' @export
3737
patch.ggalign_free_guide <- function(x) {
38-
Parent <- NextMethod()
3938
if (!is.null(guides <- attr(x, "ggalign_free_guides", exact = TRUE))) {
4039
guides <- setup_guides(guides)
40+
attr(x, "ggalign_free_guides") <- NULL
4141
}
42+
Parent <- NextMethod()
4243
ggproto("PatchFreeGuide", Parent,
4344
setup = function(self, options) {
4445
ggproto_parent(Parent, self)$setup(options)

R/alignpatch-free-lab.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ free_lab.ggalign_free_lab <- function(plot, labs = "tlbr") {
4747
#' @importFrom ggplot2 ggproto ggproto_parent
4848
#' @export
4949
patch.ggalign_free_lab <- function(x) {
50-
Parent <- NextMethod()
5150
labs <- setup_position(attr(x, "ggalign_free_labs", exact = TRUE))
51+
attr(x, "ggalign_free_labs") <- NULL
52+
Parent <- NextMethod()
5253

5354
ggproto(
5455
"PatchFreeLab", Parent,

R/alignpatch-free-space.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ free_space.ggalign_free_space <- function(plot, spaces = "tlbr") {
4141
#' @importFrom grid unit
4242
#' @export
4343
patch.ggalign_free_space <- function(x) {
44-
Parent <- NextMethod()
4544
spaces <- setup_position(attr(x, "ggalign_free_spaces", exact = TRUE))
45+
attr(x, "ggalign_free_spaces") <- NULL
46+
Parent <- NextMethod()
4647
ggproto(
4748
"PatchFreeSpace", Parent,
4849
border_sizes = function(self, gt) {

0 commit comments

Comments
 (0)