diff --git a/NAMESPACE b/NAMESPACE index c8e9c45..770490a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -21,6 +21,8 @@ S3method(print,marquee_style) S3method(print,marquee_trbl) S3method(str,marquee_style) S3method(widthDetails,marquee_grob) +S3method(xDetails,marquee_grob) +S3method(yDetails,marquee_grob) export(GeomMarquee) export(base_style) export(classic_style) diff --git a/R/grob.R b/R/grob.R index 177e865..adee543 100644 --- a/R/grob.R +++ b/R/grob.R @@ -537,6 +537,10 @@ makeContext.marquee_grob <- function(x) { tlx <- x0*crad - y1*srad tly <- x0*srad + y1*crad + x$bbox <- list( + x = rep(x$x, 4) + unit(c(blx, brx, trx, tlx), "bigpts"), + y = rep(x$y, 4) + unit(c(bly, bry, try, tly), "bigpts") + ) if (length(x$x) > 1) { x$full_width <- max(x$x + unit(pmax(blx, brx, trx, tlx), "bigpts")) - min(x$x + unit(pmin(blx, brx, trx, tlx), "bigpts")) x$full_height <- max(x$y + unit(pmax(bly, bry, try, tly), "bigpts")) - min(x$y + unit(pmin(bly, bry, try, tly), "bigpts")) @@ -684,6 +688,14 @@ heightDetails.marquee_grob <- function(x) { widthDetails.marquee_grob <- function(x) { x$full_width } +#' @export +xDetails.marquee_grob <- function(x, theta) { + xDetails(structure(x$bbox, class = "points"), theta) +} +#' @export +yDetails.marquee_grob <- function(x, theta) { + yDetails(structure(x$bbox, class = "points"), theta) +} #' @export makeContent.marquee_grob <- function(x) {