Skip to content

Commit

Permalink
rayimage v0.15.1: Turn on custom automatic height/width boxes for `re…
Browse files Browse the repository at this point in the history
…nder_text_image()`

-`render_text_image()` Add padding to vertical height by default
  • Loading branch information
tylermorganwall committed Jan 3, 2025
1 parent 15a5158 commit 1f082e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rayimage
Type: Package
Title: Image Processing for Simulated Cameras
Version: 0.15.0
Version: 0.15.1
Authors@R: c(person("Tyler", "Morgan-Wall", email = "[email protected]",
role = c("aut", "cph", "cre"), comment = c(ORCID = "0000-0002-3131-3814")),
person("Sean", "Barrett", role = c("ctb", "cph")))
Expand Down
4 changes: 2 additions & 2 deletions R/render_text_image.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ render_text_image = function(
background_alpha = 1,
use_ragg = TRUE, width = NA, height = NA,
filename = NULL,
check_text_width = TRUE, check_text_height = FALSE,
check_text_width = TRUE, check_text_height = TRUE,
preview = FALSE) {
text_metrics = systemfonts::shape_string(text,
size = size, vjust = 0.5,
Expand Down Expand Up @@ -189,7 +189,7 @@ render_text_image = function(
vert_blank = (vert_bbox[1] - 1) + (image_height - vert_bbox[2])
hori_blank = (hori_bbox[1] - 1) + (image_width - hori_bbox[2])
if(check_text_height) {
image_height = image_height - vert_blank
image_height = image_height - vert_blank + size
}
image_width = image_width - hori_blank + size
}
Expand Down

0 comments on commit 1f082e5

Please sign in to comment.