Skip to content

Commit

Permalink
reintroduce if else for height
Browse files Browse the repository at this point in the history
  • Loading branch information
ayogasekaram committed Nov 30, 2023
1 parent f677ef3 commit 2e63e70
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions R/mpf_exporters.R
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,20 @@ export_as_pdf <- function(x,
stopifnot(tools::file_ext(file) != ".pdf")
if (!is.null(colwidths) && length(colwidths) != ncol(x) + 1) {
stop(
"non-null colwidths argument must have length ncol(tt) + 1 [",
"non-null colwidths argument must have length ncol(x) + 1 [",
ncol(x) + 1, "], got length ", length(colwidths)
)
}
gp_plot <- grid::gpar(fontsize = font_size, fontfamily = font_family)

if (!is.null(height)) {
pg_height <- height
}

if (!is.null(width)) {
pg_width <- width
}

if (missing(font_size) && !missing(fontsize)) {
font_size <- fontsize
}
Expand All @@ -556,7 +564,7 @@ export_as_pdf <- function(x,
}
if (is.null(cpp)) {
cpp <- floor(grid::convertWidth(grid::unit(1, "npc"), "inches", valueOnly = TRUE) *
font_lcpi(font_family, font_size, cur_gpar$lineheight)$cpi) - sum(margins[c(2, 4)]) # left, right
formatters:::font_lcpi(font_family, font_size, cur_gpar$lineheight)$cpi) - sum(margins[c(2, 4)]) # left, right

Check warning on line 567 in R/mpf_exporters.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / Lint R code 🧶

file=R/mpf_exporters.R,line=567,col=6,[indentation_linter] Indentation should be 19 spaces but is 6 spaces.
}
if (tf_wrap && is.null(max_width)) {
max_width <- cpp
Expand Down

0 comments on commit 2e63e70

Please sign in to comment.