Skip to content

Commit

Permalink
fix: right outer border issue in grid format
Browse files Browse the repository at this point in the history
fix #650
  • Loading branch information
davidgohel committed Aug 12, 2024
1 parent 93f0f39 commit e29a47d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: flextable
Title: Functions for Tabular Reporting
Version: 0.9.7.005
Version: 0.9.7.006
Authors@R: c(
person("David", "Gohel", , "[email protected]", role = c("aut", "cre")),
person("ArData", role = "cph"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- fix vertical overlapping lines with grid output (issue #644)
- fix broken internal links in PDF file, probably due to a change in knitr or
rmarkdown (issue #632)
- fix right outer border issue in grid format (issue #650)

# flextable 0.9.6

Expand Down
6 changes: 3 additions & 3 deletions R/grid_funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ grid_data_add_cell_info <- function(grid_data, x) {
]
# apply a correction to overlapping vert. borders
setorderv(fortify_borders_data, cols = c(".part", ".row_id", ".col_id"))
fortify_borders_data[fortify_borders_data$border.width.right == shift(fortify_borders_data$border.width.left, type = "lead", fill = -1),
fortify_borders_data[
fortify_borders_data$border.width.right == shift(fortify_borders_data$border.width.left, type = "lead", fill = -1) &
fortify_borders_data$.col_id != tail(x$col_keys, 1),
c("border.width.right") := 0, by = c(".part", ".row_id")]

cell_data <- cell_data[, .SD,
Expand All @@ -154,8 +156,6 @@ grid_data_add_cell_info <- function(grid_data, x) {

cell_data <- merge(cell_data, fortify_borders_data, by = keycols)

# browser()

# merge with grid_data to keep only active cells
cell_data <- merge(grid_data[, keycols, with = FALSE], cell_data, by = keycols)

Expand Down

0 comments on commit e29a47d

Please sign in to comment.