Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
==========================================
+ Coverage 99.56% 99.68% +0.11%
==========================================
Files 9 9
Lines 919 951 +32
==========================================
+ Hits 915 948 +33
+ Misses 4 3 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Alexandra01
reviewed
May 21, 2026
| #' @param vjust numeric, the layout's object vjust. | ||
| #' @return a single logical. | ||
| #' @keywords internal | ||
| use_grob_height_for_object <- function(grob, vjust) { |
Collaborator
There was a problem hiding this comment.
I don't think this needs to be a function as it's only 1 line and is used in one place, we could just have
use_grob_height_for_object <- vjust != 0.5 && !is_flexible_grob(grob) on line 124 above the natural_height assignment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a vjust slot to gridifyObject() so users can vertically anchor the rendered object inside its layout row (e.g. vjust = 1 pins a gt/flextable to the top of a taller row instead of stretching it).
New vjust argument on gridifyObject() (default 0.5; fully backwards-compatible).
print() now sizes the object's viewport to grobHeight() for fixed-size grobs when vjust != 0.5, floored at 1 inch via grid::unit.pmax(). Flexible grobs (ggplotGrob-style gtables with null heights, recorded gTrees with childrenvp) keep the historical "fill the row" behaviour.
Detection & expression building factored into is_flexible_grob() and object_viewport_height_expr() in gridify-utils.R, with unit tests.
S4 validity rejects NA, NaN, ±Inf, non-scalar and out-of-range values.
Roxygen on vjust / object_vjust (in simple_layout(), complex_layout(), pharma_layout_*) makes the flexible-grob caveat explicit; show_spec() annotates the Vjust line accordingly.
No changes for users who don't set vjust.