Skip to content

Commit

Permalink
Add tests for add_phylopic_base and add_phylopic_legend
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Jul 30, 2024
1 parent 0a101f0 commit aa0adcd
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/add_phylopic_base.r
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ add_phylopic_base <- function(img = NULL, name = NULL, uuid = NULL,
stop("`verbose` should be a logical value.")
}
if (lifecycle::is_present(ysize)) {
lifecycle::deprecate_warn("1.4.0", "add_phylopic_base(ysize)",
lifecycle::deprecate_warn("1.5.0", "add_phylopic_base(ysize)",
"add_phylopic_base(height)")
if (is.null(height)) height <- ysize
}
Expand Down
4 changes: 2 additions & 2 deletions R/add_phylopic_legend.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ add_phylopic_legend <- function(x, y = NULL, legend,
color = NA, fill = "black",
...) {
if (lifecycle::is_present(ysize)) {
lifecycle::deprecate_warn("1.4.0", "add_phylopic_legend(ysize)",
lifecycle::deprecate_warn("1.5.0", "add_phylopic_legend(ysize)",
"add_phylopic_legend(height)")
if (is.null(height)) height <- ysize
}
Expand All @@ -76,7 +76,7 @@ add_phylopic_legend <- function(x, y = NULL, legend,
# size values
size <- args[["pt.cex"]]
if (!is.null(size)) height <- size
# Set default ysize if required
# Set default height if required
if (is.null(height)) height <- (abs(diff(leg_pos$text$y)) * 0.5)
# Extract positions
# Adjust x position slightly to account for width
Expand Down
Loading

0 comments on commit aa0adcd

Please sign in to comment.