Skip to content

Commit

Permalink
Avoid passing NAs to size and tracking for block level images
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Jan 20, 2025
1 parent ac4ade5 commit d03fe22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/grob.R
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ makeContext.marquee_grob <- function(x) {
}
} else {
### Not inline. Use block width
width <- widths[x$text$block[images$index[i]]]
width <- widths[x$text$block[images$index[i]]] %|% 0
}
} else {
### Grob has a width. Use that unless it exceeds the block width
Expand Down Expand Up @@ -842,7 +842,7 @@ makeContent.marquee_grob <- function(x) {
} else {
glyphs <- systemfonts::glyph_outline(x$shape$index[i], x$shape$font_path[i], x$shape$font_index[i], x$shape$font_size[i])
need_bitmap <- i[attr(glyphs, "missing")]
glyphs <- pathGrob(
glyphs <- if (nrow(glyphs) == 0) nullGrob() else pathGrob(
x = glyphs$x + x$shape$x_offset[i][glyphs$glyph],
y = glyphs$y + x$shape$y_offset[i][glyphs$glyph],
id = glyphs$contour,
Expand Down

0 comments on commit d03fe22

Please sign in to comment.